OLD | NEW |
---|---|
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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
366 | 366 |
367 void WebContentsDelegateAndroid::ShowRepostFormWarningDialog( | 367 void WebContentsDelegateAndroid::ShowRepostFormWarningDialog( |
368 WebContents* source) { | 368 WebContents* source) { |
369 JNIEnv* env = AttachCurrentThread(); | 369 JNIEnv* env = AttachCurrentThread(); |
370 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 370 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
371 if (obj.is_null()) | 371 if (obj.is_null()) |
372 return; | 372 return; |
373 Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj.obj()); | 373 Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj.obj()); |
374 } | 374 } |
375 | 375 |
376 void WebContentsDelegateAndroid::ToggleFullscreenModeForTab( | 376 void WebContentsDelegateAndroid::EnterFullscreenModeForTab( |
377 WebContents* web_contents, | 377 WebContents* web_contents, |
378 bool enter_fullscreen) { | 378 const GURL& origin) { |
379 JNIEnv* env = AttachCurrentThread(); | 379 JNIEnv* env = AttachCurrentThread(); |
380 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 380 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
381 if (obj.is_null()) | 381 if (obj.is_null()) |
382 return; | 382 return; |
383 Java_WebContentsDelegateAndroid_toggleFullscreenModeForTab( | 383 Java_WebContentsDelegateAndroid_toggleFullscreenModeForTab( |
384 env, obj.obj(), enter_fullscreen); | 384 env, obj.obj(), true); |
blundell
2014/12/10 20:47:15
Isn't this change a no-op? I would expect it be do
mlamouri (slow - plz ping)
2014/12/10 20:52:35
It is indeed a no-op. We don't use the origin on A
| |
385 } | |
386 | |
387 void WebContentsDelegateAndroid::ExitFullscreenModeForTab( | |
388 WebContents* web_contents) { | |
389 JNIEnv* env = AttachCurrentThread(); | |
390 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | |
391 if (obj.is_null()) | |
392 return; | |
393 Java_WebContentsDelegateAndroid_toggleFullscreenModeForTab( | |
394 env, obj.obj(), false); | |
385 } | 395 } |
386 | 396 |
387 bool WebContentsDelegateAndroid::IsFullscreenForTabOrPending( | 397 bool WebContentsDelegateAndroid::IsFullscreenForTabOrPending( |
388 const WebContents* web_contents) const { | 398 const WebContents* web_contents) const { |
389 JNIEnv* env = AttachCurrentThread(); | 399 JNIEnv* env = AttachCurrentThread(); |
390 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 400 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
391 if (obj.is_null()) | 401 if (obj.is_null()) |
392 return false; | 402 return false; |
393 return Java_WebContentsDelegateAndroid_isFullscreenForTabOrPending( | 403 return Java_WebContentsDelegateAndroid_isFullscreenForTabOrPending( |
394 env, obj.obj()); | 404 env, obj.obj()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
429 // Native JNI methods | 439 // Native JNI methods |
430 // ---------------------------------------------------------------------------- | 440 // ---------------------------------------------------------------------------- |
431 | 441 |
432 // Register native methods | 442 // Register native methods |
433 | 443 |
434 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { | 444 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { |
435 return RegisterNativesImpl(env); | 445 return RegisterNativesImpl(env); |
436 } | 446 } |
437 | 447 |
438 } // namespace web_contents_delegate_android | 448 } // namespace web_contents_delegate_android |
OLD | NEW |