| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/android/tab_web_contents_delegate_android.h" | 5 #include "chrome/browser/android/tab_web_contents_delegate_android.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 NULL, | 416 NULL, |
| 417 user_gesture); | 417 user_gesture); |
| 418 } | 418 } |
| 419 | 419 |
| 420 if (was_blocked) | 420 if (was_blocked) |
| 421 *was_blocked = !handled; | 421 *was_blocked = !handled; |
| 422 if (!handled) | 422 if (!handled) |
| 423 delete new_contents; | 423 delete new_contents; |
| 424 } | 424 } |
| 425 | 425 |
| 426 bool TabWebContentsDelegateAndroid::RequestAppBanner( |
| 427 content::WebContents* web_contents) { |
| 428 JNIEnv* env = base::android::AttachCurrentThread(); |
| 429 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
| 430 if (obj.is_null()) |
| 431 return false; |
| 432 return Java_TabWebContentsDelegateAndroid_requestAppBanner(env, obj.obj()); |
| 433 } |
| 434 |
| 426 } // namespace android | 435 } // namespace android |
| 427 } // namespace chrome | 436 } // namespace chrome |
| 428 | 437 |
| 429 void OnRendererUnresponsive(JNIEnv* env, | 438 void OnRendererUnresponsive(JNIEnv* env, |
| 430 const JavaParamRef<jclass>& clazz, | 439 const JavaParamRef<jclass>& clazz, |
| 431 const JavaParamRef<jobject>& java_web_contents) { | 440 const JavaParamRef<jobject>& java_web_contents) { |
| 432 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 441 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 433 switches::kEnableHungRendererInfoBar)) { | 442 switches::kEnableHungRendererInfoBar)) { |
| 434 return; | 443 return; |
| 435 } | 444 } |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 475 jboolean IsCapturingVideo(JNIEnv* env, | 484 jboolean IsCapturingVideo(JNIEnv* env, |
| 476 const JavaParamRef<jclass>& clazz, | 485 const JavaParamRef<jclass>& clazz, |
| 477 const JavaParamRef<jobject>& java_web_contents) { | 486 const JavaParamRef<jobject>& java_web_contents) { |
| 478 content::WebContents* web_contents = | 487 content::WebContents* web_contents = |
| 479 content::WebContents::FromJavaWebContents(java_web_contents); | 488 content::WebContents::FromJavaWebContents(java_web_contents); |
| 480 scoped_refptr<MediaStreamCaptureIndicator> indicator = | 489 scoped_refptr<MediaStreamCaptureIndicator> indicator = |
| 481 MediaCaptureDevicesDispatcher::GetInstance()-> | 490 MediaCaptureDevicesDispatcher::GetInstance()-> |
| 482 GetMediaStreamCaptureIndicator(); | 491 GetMediaStreamCaptureIndicator(); |
| 483 return indicator->IsCapturingVideo(web_contents); | 492 return indicator->IsCapturingVideo(web_contents); |
| 484 } | 493 } |
| OLD | NEW |