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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 ScopedJavaLocalRef<jobject> content_view_core = | 321 ScopedJavaLocalRef<jobject> content_view_core = |
322 content::ContentViewCore::FromWebContents(source)->GetJavaObject(); | 322 content::ContentViewCore::FromWebContents(source)->GetJavaObject(); |
323 if (content_view_core.is_null()) | 323 if (content_view_core.is_null()) |
324 return; | 324 return; |
325 Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj.obj(), | 325 Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj.obj(), |
326 content_view_core.obj()); | 326 content_view_core.obj()); |
327 } | 327 } |
328 | 328 |
329 void WebContentsDelegateAndroid::ToggleFullscreenModeForTab( | 329 void WebContentsDelegateAndroid::ToggleFullscreenModeForTab( |
330 WebContents* web_contents, | 330 WebContents* web_contents, |
331 bool enter_fullscreen) { | 331 bool enter_fullscreen, bool is_video) { |
332 JNIEnv* env = AttachCurrentThread(); | 332 JNIEnv* env = AttachCurrentThread(); |
333 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 333 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
334 if (obj.is_null()) | 334 if (obj.is_null()) |
335 return; | 335 return; |
336 Java_WebContentsDelegateAndroid_toggleFullscreenModeForTab( | 336 Java_WebContentsDelegateAndroid_toggleFullscreenModeForTab( |
337 env, obj.obj(), enter_fullscreen); | 337 env, obj.obj(), enter_fullscreen, is_video); |
338 } | 338 } |
339 | 339 |
340 bool WebContentsDelegateAndroid::IsFullscreenForTabOrPending( | 340 bool WebContentsDelegateAndroid::IsFullscreenForTabOrPending( |
341 const WebContents* web_contents) const { | 341 const WebContents* web_contents) const { |
342 JNIEnv* env = AttachCurrentThread(); | 342 JNIEnv* env = AttachCurrentThread(); |
343 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 343 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
344 if (obj.is_null()) | 344 if (obj.is_null()) |
345 return false; | 345 return false; |
346 return Java_WebContentsDelegateAndroid_isFullscreenForTabOrPending( | 346 return Java_WebContentsDelegateAndroid_isFullscreenForTabOrPending( |
347 env, obj.obj()); | 347 env, obj.obj()); |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 // Native JNI methods | 382 // Native JNI methods |
383 // ---------------------------------------------------------------------------- | 383 // ---------------------------------------------------------------------------- |
384 | 384 |
385 // Register native methods | 385 // Register native methods |
386 | 386 |
387 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { | 387 bool RegisterWebContentsDelegateAndroid(JNIEnv* env) { |
388 return RegisterNativesImpl(env); | 388 return RegisterNativesImpl(env); |
389 } | 389 } |
390 | 390 |
391 } // namespace web_contents_delegate_android | 391 } // namespace web_contents_delegate_android |
OLD | NEW |