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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
413 NULL, | 413 NULL, |
414 user_gesture); | 414 user_gesture); |
415 } | 415 } |
416 | 416 |
417 if (was_blocked) | 417 if (was_blocked) |
418 *was_blocked = !handled; | 418 *was_blocked = !handled; |
419 if (!handled) | 419 if (!handled) |
420 delete new_contents; | 420 delete new_contents; |
421 } | 421 } |
422 | 422 |
423 bool TabWebContentsDelegateAndroid::RequestAppBanner( | 423 void TabWebContentsDelegateAndroid::RequestAppBannerFromDevTools( |
424 content::WebContents* web_contents) { | 424 content::WebContents* web_contents) { |
425 JNIEnv* env = base::android::AttachCurrentThread(); | 425 JNIEnv* env = base::android::AttachCurrentThread(); |
426 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); | 426 ScopedJavaLocalRef<jobject> obj = GetJavaDelegate(env); |
427 if (obj.is_null()) | 427 if (obj.is_null()) |
428 return false; | 428 return; |
429 return Java_TabWebContentsDelegateAndroid_requestAppBanner(env, obj.obj()); | 429 Java_TabWebContentsDelegateAndroid_requestAppBanner(env, obj.obj()); |
430 } | 430 } |
431 | 431 |
432 } // namespace android | 432 } // namespace android |
433 } // namespace chrome | 433 } // namespace chrome |
434 | 434 |
435 void OnRendererUnresponsive(JNIEnv* env, | 435 void OnRendererUnresponsive(JNIEnv* env, |
436 const JavaParamRef<jclass>& clazz, | 436 const JavaParamRef<jclass>& clazz, |
437 const JavaParamRef<jobject>& java_web_contents) { | 437 const JavaParamRef<jobject>& java_web_contents) { |
438 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( | 438 if (!base::CommandLine::ForCurrentProcess()->HasSwitch( |
439 switches::kEnableHungRendererInfoBar)) { | 439 switches::kEnableHungRendererInfoBar)) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 jboolean IsCapturingVideo(JNIEnv* env, | 481 jboolean IsCapturingVideo(JNIEnv* env, |
482 const JavaParamRef<jclass>& clazz, | 482 const JavaParamRef<jclass>& clazz, |
483 const JavaParamRef<jobject>& java_web_contents) { | 483 const JavaParamRef<jobject>& java_web_contents) { |
484 content::WebContents* web_contents = | 484 content::WebContents* web_contents = |
485 content::WebContents::FromJavaWebContents(java_web_contents); | 485 content::WebContents::FromJavaWebContents(java_web_contents); |
486 scoped_refptr<MediaStreamCaptureIndicator> indicator = | 486 scoped_refptr<MediaStreamCaptureIndicator> indicator = |
487 MediaCaptureDevicesDispatcher::GetInstance()-> | 487 MediaCaptureDevicesDispatcher::GetInstance()-> |
488 GetMediaStreamCaptureIndicator(); | 488 GetMediaStreamCaptureIndicator(); |
489 return indicator->IsCapturingVideo(web_contents); | 489 return indicator->IsCapturingVideo(web_contents); |
490 } | 490 } |
OLD | NEW |