Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1146)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/fullscreen/FullscreenHtmlApiHandler.java

Issue 986653004: Add fullscreen permission controls to settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
+ }
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698