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

Side by Side Diff: chrome/browser/component/web_contents_delegate_android/web_contents_delegate_android.cc

Issue 11360077: Start hooking up "element.requestFullscreen()" in chrome for android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses the comment Created 8 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/component/web_contents_delegate_android/web_contents_delegate_android.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/component/web_contents_delegate_android/web_contents_de legate_android.h" 5 #include "chrome/browser/component/web_contents_delegate_android/web_contents_de legate_android.h"
6 6
7 #include <android/keycodes.h> 7 #include <android/keycodes.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 10 #include "base/android/jni_string.h"
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 if (obj.is_null()) 273 if (obj.is_null())
274 return; 274 return;
275 ScopedJavaLocalRef<jobject> content_view_core = 275 ScopedJavaLocalRef<jobject> content_view_core =
276 content::ContentViewCore::FromWebContents(source)->GetJavaObject(); 276 content::ContentViewCore::FromWebContents(source)->GetJavaObject();
277 if (content_view_core.is_null()) 277 if (content_view_core.is_null())
278 return; 278 return;
279 Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj.obj(), 279 Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj.obj(),
280 content_view_core.obj()); 280 content_view_core.obj());
281 } 281 }
282 282
283 void WebContentsDelegateAndroid::ToggleFullscreenModeForTab(
284 WebContents* web_contents,
285 bool enter_fullscreen) {
286 JNIEnv* env = AttachCurrentThread();
287 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
288 if (obj.is_null())
289 return;
290 Java_WebContentsDelegateAndroid_toggleFullscreenModeForTab(
291 env, obj.obj(), enter_fullscreen);
292 }
293
294 bool WebContentsDelegateAndroid::IsFullscreenForTabOrPending(
295 const WebContents* web_contents) const {
296 JNIEnv* env = AttachCurrentThread();
297 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
298 if (obj.is_null())
299 return false;
300 return Java_WebContentsDelegateAndroid_isFullscreenForTabOrPending(
301 env, obj.obj());
302 }
303
283 // ---------------------------------------------------------------------------- 304 // ----------------------------------------------------------------------------
284 // Native JNI methods 305 // Native JNI methods
285 // ---------------------------------------------------------------------------- 306 // ----------------------------------------------------------------------------
286 307
287 // Register native methods 308 // Register native methods
288 309
289 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { 310 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) {
290 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) { 311 if (!HasClass(env, kWebContentsDelegateAndroidClassPath)) {
291 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!"; 312 DLOG(ERROR) << "Unable to find class WebContentsDelegateAndroid!";
292 return false; 313 return false;
293 } 314 }
294 return RegisterNativesImpl(env); 315 return RegisterNativesImpl(env);
295 } 316 }
296 317
297 } // namespace web_contents_delegate_android 318 } // namespace web_contents_delegate_android
OLDNEW
« no previous file with comments | « chrome/browser/component/web_contents_delegate_android/web_contents_delegate_android.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698