Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3950)

Unified Diff: chrome/browser/android/chrome_web_contents_delegate_android.cc

Issue 942873002: Upstream Tab's audio/video capturing APIs to ChromeWebContentsDelegateAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ChromeWebContentsDelegateAndroid.java ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
+}
+
« no previous file with comments | « chrome/android/java/src/org/chromium/chrome/browser/ChromeWebContentsDelegateAndroid.java ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698