From c9b5556351b59caec77b4eec1ad30652fec6a4d9 Mon Sep 17 00:00:00 2001 From: Andrei Popescu Date: Tue, 7 Jul 2009 10:51:15 +0100 Subject: Add fullscreen support back in. --- src/com/android/browser/BrowserActivity.java | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/com/android/browser/BrowserActivity.java b/src/com/android/browser/BrowserActivity.java index e65e8e1..c69a115 100644 --- a/src/com/android/browser/BrowserActivity.java +++ b/src/com/android/browser/BrowserActivity.java @@ -113,6 +113,7 @@ import android.webkit.PluginManager; import android.webkit.SslErrorHandler; import android.webkit.URLUtil; import android.webkit.WebChromeClient; +import android.webkit.WebChromeClient.CustomViewCallback; import android.webkit.WebHistoryItem; import android.webkit.WebIconDatabase; import android.webkit.WebStorage; @@ -3729,20 +3730,23 @@ public class BrowserActivity extends Activity } @Override - public void onShowCustomView(View view) { + public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) { if (mCustomView != null) return; // Add the custom view to its container. mCustomViewContainer.addView(view, COVER_SCREEN_GRAVITY_CENTER); mCustomView = view; + mCustomViewCallback = callback; // Save the menu state and set it to empty while the custom // view is showing. mOldMenuState = mMenuState; mMenuState = EMPTY_MENU; + // Hide the content view. + mContentView.setVisibility(View.GONE); // Finally show the custom view container. - mCustomViewContainer.setVisibility(View.VISIBLE); - mCustomViewContainer.bringToFront(); + mCustomViewContainer.setVisibility(View.VISIBLE); + mCustomViewContainer.bringToFront(); } @Override @@ -3750,6 +3754,8 @@ public class BrowserActivity extends Activity if (mCustomView == null) return; + // Hide the custom view. + mCustomView.setVisibility(View.GONE); // Remove the custom view from its container. mCustomViewContainer.removeView(mCustomView); mCustomView = null; @@ -3757,6 +3763,9 @@ public class BrowserActivity extends Activity mMenuState = mOldMenuState; mOldMenuState = EMPTY_MENU; mCustomViewContainer.setVisibility(View.GONE); + mCustomViewCallback.onCustomViewHidden(); + // Show the content view. + mContentView.setVisibility(View.VISIBLE); } /** @@ -4873,6 +4882,7 @@ public class BrowserActivity extends Activity private ImageGrid mTabOverview; private View mCustomView; private FrameLayout mCustomViewContainer; + private WebChromeClient.CustomViewCallback mCustomViewCallback; // FIXME, temp address onPrepareMenu performance problem. When we move everything out of // view, we should rewrite this. -- cgit v1.1