summaryrefslogtreecommitdiffstats
path: root/android_webview/native
diff options
context:
space:
mode:
authormlamouri <mlamouri@chromium.org>2015-01-17 05:23:53 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-17 13:24:40 +0000
commit7a78d6fd7dc3241a91a614a09f9c59a0e4454135 (patch)
treede49119a8e5094d18b4374ee88b57e31d5e1bfc1 /android_webview/native
parentc3558c8a4070d69dec189e84aa623c004dd90310 (diff)
downloadchromium_src-7a78d6fd7dc3241a91a614a09f9c59a0e4454135.zip
chromium_src-7a78d6fd7dc3241a91a614a09f9c59a0e4454135.tar.gz
chromium_src-7a78d6fd7dc3241a91a614a09f9c59a0e4454135.tar.bz2
Fullscreen: make fullscreen requests come from RenderFrame.
This is implementing WebFrameClient::enterFullscreen and ::exitFullscreen in RenderFrameImpl which allows to associate a fullscreen request to a specific frame. This is keeping track of the origin by getting it from the RenderFrameHost then forwards the call all the way to the WebContentsDelegate. This is also changing the permission handling by properly differentiate requesting and embedding origins. If permission is given to a top frame, it will always be allowed if that origin is embedded. In addition, it allows OOPIF to request to go fullscreen. It does not make them fullscreen but the top frame is because of the widget not yet working correctly for OOPIF. This part of a multi-sided CL: Part 1: https://codereview.chromium.org/790543003/ Part 2: <this> Part 3: https://codereview.chromium.org/782243003/ BUG=374854 TEST=Requires MANUAL testing because of fullscreen-related tests being all disabled for flakyness. Steps are: - Remove all exceptions for fullscreen: - Go to chrome://settings/content - Click on "Manage Exceptions" in Fullscreen section; - Remove all exceptions; - Go to http://blog.chromium.org/2014/12/chrome-40-beta-powerful-offline-and.html - Start the video and fullscreen it; - The UI prompt should ask for fullscreen permission for youtube.com - Click ALLOW - Go to https://www.youtube.com, play any video and go fullscreen; - You should see the same message as before, asking for permission. - Press ESC; - Remove all fullscreen exceptions as in the first step; - Go back to http://blog.chromium.org/2014/12/chrome-40-beta-powerful-offline-and.html - Play the video, go fullscreen - It should ask again for permission, don't give it, press ESC; - Go to https://www.youtube.com, play any video and go fullscreen; - Press ALLOW and leave the video; - Go back to http://blog.chromium.org/2014/12/chrome-40-beta-powerful-offline-and.html - Play the video, go fullscreen - The message should no longer ask for permission. Review URL: https://codereview.chromium.org/789533002 Cr-Commit-Position: refs/heads/master@{#312038}
Diffstat (limited to 'android_webview/native')
-rw-r--r--android_webview/native/aw_web_contents_delegate.cc10
-rw-r--r--android_webview/native/aw_web_contents_delegate.h8
2 files changed, 16 insertions, 2 deletions
diff --git a/android_webview/native/aw_web_contents_delegate.cc b/android_webview/native/aw_web_contents_delegate.cc
index ca49bb8..b18354e 100644
--- a/android_webview/native/aw_web_contents_delegate.cc
+++ b/android_webview/native/aw_web_contents_delegate.cc
@@ -208,6 +208,16 @@ void AwWebContentsDelegate::RequestMediaAccessPermission(
new MediaAccessPermissionRequest(request, callback)));
}
+void AwWebContentsDelegate::EnterFullscreenModeForTab(
+ content::WebContents* web_contents, const GURL& origin) {
+ ToggleFullscreenModeForTab(web_contents, true);
+}
+
+void AwWebContentsDelegate::ExitFullscreenModeForTab(
+ content::WebContents* web_contents) {
+ ToggleFullscreenModeForTab(web_contents, false);
+}
+
void AwWebContentsDelegate::ToggleFullscreenModeForTab(
content::WebContents* web_contents, bool enter_fullscreen) {
JNIEnv* env = AttachCurrentThread();
diff --git a/android_webview/native/aw_web_contents_delegate.h b/android_webview/native/aw_web_contents_delegate.h
index b3c273e..1346267 100644
--- a/android_webview/native/aw_web_contents_delegate.h
+++ b/android_webview/native/aw_web_contents_delegate.h
@@ -53,12 +53,16 @@ class AwWebContentsDelegate
content::WebContents* web_contents,
const content::MediaStreamRequest& request,
const content::MediaResponseCallback& callback) override;
- virtual void ToggleFullscreenModeForTab(content::WebContents* web_contents,
- bool enter_fullscreen) override;
+ virtual void EnterFullscreenModeForTab(content::WebContents* web_contents,
+ const GURL& origin) override;
+ virtual void ExitFullscreenModeForTab(
+ content::WebContents* web_contents) override;
virtual bool IsFullscreenForTabOrPending(
const content::WebContents* web_contents) const override;
private:
+ void ToggleFullscreenModeForTab(content::WebContents* web_contents,
+ bool enter_fullscreen);
bool is_fullscreen_;
};