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

Unified Diff: android_webview/native/aw_web_contents_delegate.cc

Issue 865613002: Reduce duplicated code in AwWebContentsDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « android_webview/native/aw_web_contents_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_web_contents_delegate.cc
diff --git a/android_webview/native/aw_web_contents_delegate.cc b/android_webview/native/aw_web_contents_delegate.cc
index b18354e6a2e863fb519b66c5d30d9d0c92610c05..822db777c75410650c9a7fe969ce984818c7502f 100644
--- a/android_webview/native/aw_web_contents_delegate.cc
+++ b/android_webview/native/aw_web_contents_delegate.cc
@@ -210,25 +210,15 @@ void AwWebContentsDelegate::RequestMediaAccessPermission(
void AwWebContentsDelegate::EnterFullscreenModeForTab(
content::WebContents* web_contents, const GURL& origin) {
- ToggleFullscreenModeForTab(web_contents, true);
+ WebContentsDelegateAndroid::EnterFullscreenModeForTab(web_contents, origin);
+ is_fullscreen_ = true;
+ web_contents->GetRenderViewHost()->WasResized();
}
void AwWebContentsDelegate::ExitFullscreenModeForTab(
content::WebContents* web_contents) {
- ToggleFullscreenModeForTab(web_contents, false);
-}
-
-void AwWebContentsDelegate::ToggleFullscreenModeForTab(
- content::WebContents* web_contents, bool enter_fullscreen) {
- JNIEnv* env = AttachCurrentThread();
-
- ScopedJavaLocalRef<jobject> java_delegate = GetJavaDelegate(env);
- if (java_delegate.obj()) {
- Java_AwWebContentsDelegate_toggleFullscreenModeForTab(
- env, java_delegate.obj(), enter_fullscreen);
- }
- is_fullscreen_ = enter_fullscreen;
- web_contents->GetRenderViewHost()->WasResized();
+ is_fullscreen_ = false;
+ WebContentsDelegateAndroid::ExitFullscreenModeForTab(web_contents);
Ignacio Solla 2015/01/21 14:23:04 aren't you misssing the call to web_contents->Get
Hugo Holgersson 2015/01/21 14:26:44 Done.
}
bool AwWebContentsDelegate::IsFullscreenForTabOrPending(
« no previous file with comments | « android_webview/native/aw_web_contents_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698