Index: chrome/browser/android/chrome_web_contents_delegate_android.cc |
diff --git a/chrome/browser/android/chrome_web_contents_delegate_android.cc b/chrome/browser/android/chrome_web_contents_delegate_android.cc |
index 6a71f28f9a70d52f9cceb22683c4fa8c11182a7e..7ea78eda9d05c552952d3b3a3b098ef8f08979c3 100644 |
--- a/chrome/browser/android/chrome_web_contents_delegate_android.cc |
+++ b/chrome/browser/android/chrome_web_contents_delegate_android.cc |
@@ -10,6 +10,7 @@ |
#include "chrome/browser/chrome_notification_types.h" |
#include "chrome/browser/file_select_helper.h" |
#include "chrome/browser/media/media_capture_devices_dispatcher.h" |
+#include "chrome/browser/media/media_stream_capture_indicator.h" |
#include "chrome/browser/media/protected_media_identifier_permission_context.h" |
#include "chrome/browser/media/protected_media_identifier_permission_context_factory.h" |
#include "chrome/browser/prerender/prerender_manager.h" |
@@ -347,3 +348,25 @@ void ChromeWebContentsDelegateAndroid::AddNewContents( |
} // namespace android |
} // namespace chrome |
+ |
+jboolean IsCapturingAudio(JNIEnv* env, |
qinmin
2015/02/20 18:34:59
is there a way to add nested namespaces? Maybe we
Yaron
2015/02/23 14:26:24
You can using JNINamespace but not selectively for
|
+ jclass clazz, |
+ jobject java_web_contents) { |
+ content::WebContents* web_contents = |
+ content::WebContents::FromJavaWebContents(java_web_contents); |
+ scoped_refptr<MediaStreamCaptureIndicator> indicator = |
+ MediaCaptureDevicesDispatcher::GetInstance()-> |
+ GetMediaStreamCaptureIndicator(); |
+ return indicator->IsCapturingAudio(web_contents); |
+} |
+ |
+jboolean IsCapturingVideo(JNIEnv* env, |
+ jclass clazz,jobject java_web_contents) { |
qinmin
2015/02/20 18:34:59
nit: match this with the style above
Yaron
2015/02/23 14:26:24
Done.
|
+ content::WebContents* web_contents = |
+ content::WebContents::FromJavaWebContents(java_web_contents); |
+ scoped_refptr<MediaStreamCaptureIndicator> indicator = |
+ MediaCaptureDevicesDispatcher::GetInstance()-> |
+ GetMediaStreamCaptureIndicator(); |
+ return indicator->IsCapturingVideo(web_contents); |
+} |
+ |