summaryrefslogtreecommitdiffstats
path: root/src/com/android/browser/BaseUi.java
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2011-06-01 14:50:42 -0400
committerDerek Sollenberger <djsollen@google.com>2011-06-02 08:42:20 -0400
commit2d4f1e2553dee6bce5a12162ff6d4459babe2512 (patch)
treef2c65cc84593c1f198067024808c4022ba22bc7b /src/com/android/browser/BaseUi.java
parentaed9c54d8e67bb683a5a415b3775525a3ac00508 (diff)
downloadpackages_apps_Browser-2d4f1e2553dee6bce5a12162ff6d4459babe2512.tar.gz
packages_apps_Browser-2d4f1e2553dee6bce5a12162ff6d4459babe2512.tar.bz2
packages_apps_Browser-2d4f1e2553dee6bce5a12162ff6d4459babe2512.zip
Add API to allow plugins to lock their orientation in full-screen
This CL has companion changes in the framework and webkit. bug: 3398386 Change-Id: Iea198ae6b74c68506e605ca8c401f199e2455416
Diffstat (limited to 'src/com/android/browser/BaseUi.java')
-rw-r--r--src/com/android/browser/BaseUi.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java
index e2fea168e..b20e661ff 100644
--- a/src/com/android/browser/BaseUi.java
+++ b/src/com/android/browser/BaseUi.java
@@ -86,6 +86,7 @@ public abstract class BaseUi implements UI, WebViewFactory {
private View mCustomView;
private WebChromeClient.CustomViewCallback mCustomViewCallback;
+ private int mOriginalOrientation;
private CombinedBookmarkHistoryView mComboView;
@@ -540,7 +541,7 @@ public abstract class BaseUi implements UI, WebViewFactory {
}
@Override
- public void showCustomView(View view,
+ public void showCustomView(View view, int requestedOrientation,
WebChromeClient.CustomViewCallback callback) {
// if a view already exists then immediately terminate the new one
if (mCustomView != null) {
@@ -548,6 +549,8 @@ public abstract class BaseUi implements UI, WebViewFactory {
return;
}
+ mOriginalOrientation = mActivity.getRequestedOrientation();
+
// Add the custom view to its container.
mCustomViewContainer.addView(view, COVER_SCREEN_GRAVITY_CENTER);
mCustomView = view;
@@ -556,6 +559,7 @@ public abstract class BaseUi implements UI, WebViewFactory {
mContentView.setVisibility(View.GONE);
// Finally show the custom view container.
setStatusBarVisibility(false);
+ mActivity.setRequestedOrientation(requestedOrientation);
mCustomViewContainer.setVisibility(View.VISIBLE);
mCustomViewContainer.bringToFront();
}
@@ -573,6 +577,7 @@ public abstract class BaseUi implements UI, WebViewFactory {
mCustomViewContainer.setVisibility(View.GONE);
mCustomViewCallback.onCustomViewHidden();
// Show the content view.
+ mActivity.setRequestedOrientation(mOriginalOrientation);
setStatusBarVisibility(true);
mContentView.setVisibility(View.VISIBLE);
}