| 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 320 |
| 321 void WebContentsDelegateAndroid::ShowRepostFormWarningDialog( | 321 void WebContentsDelegateAndroid::ShowRepostFormWarningDialog( |
| 322 WebContents* source) { | 322 WebContents* source) { |
| 323 JNIEnv* env = AttachCurrentThread(); | 323 JNIEnv* env = AttachCurrentThread(); |
| 324 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 324 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 325 if (obj.is_null()) | 325 if (obj.is_null()) |
| 326 return; | 326 return; |
| 327 Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj); | 327 Java_WebContentsDelegateAndroid_showRepostFormWarningDialog(env, obj); |
| 328 } | 328 } |
| 329 | 329 |
| 330 ScopedJavaLocalRef<jobject> |
| 331 WebContentsDelegateAndroid::GetContentVideoViewEmbedder() { |
| 332 JNIEnv* env = AttachCurrentThread(); |
| 333 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 334 if (obj.is_null()) |
| 335 return ScopedJavaLocalRef<jobject>(); |
| 336 |
| 337 return Java_WebContentsDelegateAndroid_getContentVideoViewEmbedder(env, obj); |
| 338 } |
| 339 |
| 340 bool WebContentsDelegateAndroid::ShouldBlockMediaRequest(const GURL& url) { |
| 341 JNIEnv* env = AttachCurrentThread(); |
| 342 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 343 if (obj.is_null()) |
| 344 return false; |
| 345 ScopedJavaLocalRef<jstring> j_url = ConvertUTF8ToJavaString(env, url.spec()); |
| 346 return Java_WebContentsDelegateAndroid_shouldBlockMediaRequest(env, obj, j_url
); |
| 347 } |
| 348 |
| 330 void WebContentsDelegateAndroid::EnterFullscreenModeForTab( | 349 void WebContentsDelegateAndroid::EnterFullscreenModeForTab( |
| 331 WebContents* web_contents, | 350 WebContents* web_contents, |
| 332 const GURL& origin) { | 351 const GURL& origin) { |
| 333 JNIEnv* env = AttachCurrentThread(); | 352 JNIEnv* env = AttachCurrentThread(); |
| 334 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 353 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 335 if (obj.is_null()) | 354 if (obj.is_null()) |
| 336 return; | 355 return; |
| 337 Java_WebContentsDelegateAndroid_toggleFullscreenModeForTab(env, obj, true); | 356 Java_WebContentsDelegateAndroid_toggleFullscreenModeForTab(env, obj, true); |
| 338 } | 357 } |
| 339 | 358 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 validation_message_bubble_->SetPositionRelativeToAnchor( | 404 validation_message_bubble_->SetPositionRelativeToAnchor( |
| 386 rwhv->GetRenderWidgetHost(), anchor_in_root_view); | 405 rwhv->GetRenderWidgetHost(), anchor_in_root_view); |
| 387 } | 406 } |
| 388 } | 407 } |
| 389 | 408 |
| 390 void WebContentsDelegateAndroid::RequestAppBannerFromDevTools( | 409 void WebContentsDelegateAndroid::RequestAppBannerFromDevTools( |
| 391 content::WebContents* web_contents) { | 410 content::WebContents* web_contents) { |
| 392 } | 411 } |
| 393 | 412 |
| 394 } // namespace web_contents_delegate_android | 413 } // namespace web_contents_delegate_android |
| OLD | NEW |