diff options
-rw-r--r-- | src/com/android/browser/BaseUi.java | 7 | ||||
-rw-r--r-- | src/com/android/browser/Controller.java | 4 | ||||
-rw-r--r-- | src/com/android/browser/Tab.java | 8 | ||||
-rw-r--r-- | src/com/android/browser/UI.java | 3 | ||||
-rw-r--r-- | src/com/android/browser/WebViewController.java | 3 | ||||
-rw-r--r-- | src/com/android/browser/XLargeUi.java | 5 |
6 files changed, 22 insertions, 8 deletions
diff --git a/src/com/android/browser/BaseUi.java b/src/com/android/browser/BaseUi.java index e2fea16..b20e661 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); } diff --git a/src/com/android/browser/Controller.java b/src/com/android/browser/Controller.java index 1f5c8f0..3974a9c 100644 --- a/src/com/android/browser/Controller.java +++ b/src/com/android/browser/Controller.java @@ -1079,14 +1079,14 @@ public class Controller return (searchEngine != null && searchEngine.supportsVoiceSearch()); } - public void showCustomView(Tab tab, View view, + public void showCustomView(Tab tab, View view, int requestedOrientation, WebChromeClient.CustomViewCallback callback) { if (tab.inForeground()) { if (mUi.isCustomViewShowing()) { callback.onCustomViewHidden(); return; } - mUi.showCustomView(view, callback); + mUi.showCustomView(view, requestedOrientation, callback); // Save the menu state and set it to empty while the custom // view is showing. mOldMenuState = mMenuState; diff --git a/src/com/android/browser/Tab.java b/src/com/android/browser/Tab.java index 98d209e..b0a991a 100644 --- a/src/com/android/browser/Tab.java +++ b/src/com/android/browser/Tab.java @@ -983,8 +983,14 @@ class Tab { @Override public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) { + onShowCustomView(view, mActivity.getRequestedOrientation(), callback); + } + + @Override + public void onShowCustomView(View view, int requestedOrientation, + WebChromeClient.CustomViewCallback callback) { if (mInForeground) mWebViewController.showCustomView(Tab.this, view, - callback); + requestedOrientation, callback); } @Override diff --git a/src/com/android/browser/UI.java b/src/com/android/browser/UI.java index 22851f1..a6356a3 100644 --- a/src/com/android/browser/UI.java +++ b/src/com/android/browser/UI.java @@ -81,7 +81,8 @@ public interface UI { public void hideComboView(); - public void showCustomView(View view, CustomViewCallback callback); + public void showCustomView(View view, int requestedOrientation, + CustomViewCallback callback); public void onHideCustomView(); diff --git a/src/com/android/browser/WebViewController.java b/src/com/android/browser/WebViewController.java index 87703bd..018af99 100644 --- a/src/com/android/browser/WebViewController.java +++ b/src/com/android/browser/WebViewController.java @@ -72,7 +72,8 @@ public interface WebViewController { void onDownloadStart(Tab tab, String url, String useragent, String contentDisposition, String mimeType, long contentLength); - void showCustomView(Tab tab, View view, WebChromeClient.CustomViewCallback callback); + void showCustomView(Tab tab, View view, int requestedOrientation, + WebChromeClient.CustomViewCallback callback); void hideCustomView(); diff --git a/src/com/android/browser/XLargeUi.java b/src/com/android/browser/XLargeUi.java index 4bfd3cf..1530ed3 100644 --- a/src/com/android/browser/XLargeUi.java +++ b/src/com/android/browser/XLargeUi.java @@ -353,8 +353,9 @@ public class XLargeUi extends BaseUi implements ScrollListener { } @Override - public void showCustomView(View view, CustomViewCallback callback) { - super.showCustomView(view, callback); + public void showCustomView(View view, int requestedOrientation, + CustomViewCallback callback) { + super.showCustomView(view, requestedOrientation, callback); mActivity.getActionBar().hide(); } |