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

Side by Side Diff: components/web_contents_delegate_android/web_contents_delegate_android.cc

Issue 789533002: Fullscreen: make fullscreen requests come from RenderFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make try happy 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 unified diff | Download patch
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 "components/web_contents_delegate_android/web_contents_delegate_android .h" 5 #include "components/web_contents_delegate_android/web_contents_delegate_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_array.h" 10 #include "base/android/jni_array.h"
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 367
368 void WebContentsDelegateAndroid::ShowRepostFormWarningDialog( 368 void WebContentsDelegateAndroid::ShowRepostFormWarningDialog(
369 WebContents* source) { 369 WebContents* source) {
370 JNIEnv* env = AttachCurrentThread(); 370 JNIEnv* env = AttachCurrentThread();
371 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); 371 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
372 if (obj.is_null()) 372 if (obj.is_null())
373 return; 373 return;
374 Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj.obj()); 374 Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj.obj());
375 } 375 }
376 376
377 void WebContentsDelegateAndroid::ToggleFullscreenModeForTab( 377 void WebContentsDelegateAndroid::EnterFullscreenModeForTab(
378 WebContents* web_contents, 378 WebContents* web_contents,
379 bool enter_fullscreen) { 379 const GURL& origin) {
380 JNIEnv* env = AttachCurrentThread(); 380 JNIEnv* env = AttachCurrentThread();
381 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); 381 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
382 if (obj.is_null()) 382 if (obj.is_null())
383 return; 383 return;
384 Java_WebContentsDelegateAndroid_toggleFullscreenModeForTab( 384 Java_WebContentsDelegateAndroid_toggleFullscreenModeForTab(env, obj.obj(),
385 env, obj.obj(), enter_fullscreen); 385 true);
386 }
387
388 void WebContentsDelegateAndroid::ExitFullscreenModeForTab(
389 WebContents* web_contents) {
390 JNIEnv* env = AttachCurrentThread();
391 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
392 if (obj.is_null())
393 return;
394 Java_WebContentsDelegateAndroid_toggleFullscreenModeForTab(env, obj.obj(),
395 false);
386 } 396 }
387 397
388 bool WebContentsDelegateAndroid::IsFullscreenForTabOrPending( 398 bool WebContentsDelegateAndroid::IsFullscreenForTabOrPending(
389 const WebContents* web_contents) const { 399 const WebContents* web_contents) const {
390 JNIEnv* env = AttachCurrentThread(); 400 JNIEnv* env = AttachCurrentThread();
391 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); 401 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env);
392 if (obj.is_null()) 402 if (obj.is_null())
393 return false; 403 return false;
394 return Java_WebContentsDelegateAndroid_isFullscreenForTabOrPending( 404 return Java_WebContentsDelegateAndroid_isFullscreenForTabOrPending(
395 env, obj.obj()); 405 env, obj.obj());
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 // Native JNI methods 440 // Native JNI methods
431 // ---------------------------------------------------------------------------- 441 // ----------------------------------------------------------------------------
432 442
433 // Register native methods 443 // Register native methods
434 444
435 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { 445 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) {
436 return RegisterNativesImpl(env); 446 return RegisterNativesImpl(env);
437 } 447 }
438 448
439 } // namespace web_contents_delegate_android 449 } // namespace web_contents_delegate_android
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698