Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java |
| index 6f16a74d1e3bddcc61b5f7af16c7748e655bcea6..03fa3214d0077e81b6bb24030dacca83b1e921ec 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java |
| @@ -13,6 +13,7 @@ import android.os.Build; |
| import android.os.Bundle; |
| import android.os.Handler; |
| import android.os.Message; |
| +import android.util.Log; |
| import android.view.Gravity; |
| import android.view.View; |
| import android.view.View.OnLayoutChangeListener; |
| @@ -21,10 +22,14 @@ import android.view.WindowManager; |
| import org.chromium.chrome.R; |
| import org.chromium.chrome.browser.Tab; |
| +import org.chromium.chrome.browser.UrlUtilities; |
| +import org.chromium.chrome.browser.preferences.website.ContentSetting; |
| +import org.chromium.chrome.browser.preferences.website.FullscreenInfo; |
| import org.chromium.chrome.browser.widget.TextBubble; |
| import org.chromium.content.browser.ContentViewCore; |
| import java.lang.ref.WeakReference; |
| +import java.net.URI; |
| /** |
| * Handles updating the UI based on requests to the HTML Fullscreen API. |
| @@ -48,6 +53,8 @@ public class FullscreenHtmlApiHandler { |
| private static final int NOTIFICATION_BUBBLE_ALPHA = 252; // 255 * 0.99 |
| + private static final String TAG = "FullscreenHtmlApiHandler"; |
| + |
| private static boolean sFullscreenNotificationShown; |
| private final Window mWindow; |
| @@ -66,6 +73,7 @@ public class FullscreenHtmlApiHandler { |
| private TextBubble mNotificationBubble; |
| private OnLayoutChangeListener mFullscreenOnLayoutChangeListener; |
| + private FullscreenInfoBarDelegate mFullscreenInfoBarDelegate; |
| /** |
| * Delegate that allows embedders to react to fullscreen API requests. |
| @@ -273,6 +281,10 @@ public class FullscreenHtmlApiHandler { |
| }; |
| contentView.addOnLayoutChangeListener(mFullscreenOnLayoutChangeListener); |
| contentViewCore.getWebContents().exitFullscreen(); |
| + if (mFullscreenInfoBarDelegate != null) { |
| + mFullscreenInfoBarDelegate.closeFullscreenInfoBar(); |
| + mFullscreenInfoBarDelegate = null; |
| + } |
| } |
| /** |
| @@ -325,6 +337,16 @@ public class FullscreenHtmlApiHandler { |
| contentView.setSystemUiVisibility(systemUiVisibility); |
| mContentViewCoreInFullscreen = contentViewCore; |
| mTabInFullscreen = tab; |
| + FullscreenInfo fullscreenInfo = new FullscreenInfo(tab.getUrl(), null); |
| + ContentSetting fullscreenPermission = fullscreenInfo.getContentSetting(); |
| + if (fullscreenPermission != ContentSetting.ALLOW) { |
| + try { |
| + String origin = UrlUtilities.getOriginForDisplay(new URI(tab.getUrl()), true); |
|
Ted C
2015/03/12 21:21:34
any reason this isn't done inside of the infobar d
qinmin
2015/03/17 23:49:29
Done. Moved the Origin logic into the native Fulls
|
| + mFullscreenInfoBarDelegate = new FullscreenInfoBarDelegate(this, tab, origin); |
| + } catch (java.net.URISyntaxException e) { |
| + Log.w(TAG, "Cannot parse fullscreen tab URI", e); |
| + } |
| + } |
| } |
| /** |