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

Side by Side Diff: chrome/browser/android/tab_web_contents_delegate_android.cc

Issue 2123863004: ScreenCapture for Android phase1, part II (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments and rebase Created 4 years, 4 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 unified diff | Download patch
OLDNEW
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 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 ->OnRendererResponsive(); 462 ->OnRendererResponsive();
463 infobar_service->RemoveInfoBar(hung_renderer_infobar); 463 infobar_service->RemoveInfoBar(hung_renderer_infobar);
464 } 464 }
465 465
466 jboolean IsCapturingAudio(JNIEnv* env, 466 jboolean IsCapturingAudio(JNIEnv* env,
467 const JavaParamRef<jclass>& clazz, 467 const JavaParamRef<jclass>& clazz,
468 const JavaParamRef<jobject>& java_web_contents) { 468 const JavaParamRef<jobject>& java_web_contents) {
469 content::WebContents* web_contents = 469 content::WebContents* web_contents =
470 content::WebContents::FromJavaWebContents(java_web_contents); 470 content::WebContents::FromJavaWebContents(java_web_contents);
471 scoped_refptr<MediaStreamCaptureIndicator> indicator = 471 scoped_refptr<MediaStreamCaptureIndicator> indicator =
472 MediaCaptureDevicesDispatcher::GetInstance()-> 472 MediaCaptureDevicesDispatcher::GetInstance()
473 GetMediaStreamCaptureIndicator(); 473 ->GetMediaStreamCaptureIndicator();
474 return indicator->IsCapturingAudio(web_contents); 474 return indicator->IsCapturingAudio(web_contents);
475 } 475 }
476 476
477 jboolean IsCapturingVideo(JNIEnv* env, 477 jboolean IsCapturingVideo(JNIEnv* env,
478 const JavaParamRef<jclass>& clazz, 478 const JavaParamRef<jclass>& clazz,
479 const JavaParamRef<jobject>& java_web_contents) { 479 const JavaParamRef<jobject>& java_web_contents) {
480 content::WebContents* web_contents = 480 content::WebContents* web_contents =
481 content::WebContents::FromJavaWebContents(java_web_contents); 481 content::WebContents::FromJavaWebContents(java_web_contents);
482 scoped_refptr<MediaStreamCaptureIndicator> indicator = 482 scoped_refptr<MediaStreamCaptureIndicator> indicator =
483 MediaCaptureDevicesDispatcher::GetInstance()-> 483 MediaCaptureDevicesDispatcher::GetInstance()
484 GetMediaStreamCaptureIndicator(); 484 ->GetMediaStreamCaptureIndicator();
485 return indicator->IsCapturingVideo(web_contents); 485 return indicator->IsCapturingVideo(web_contents);
486 } 486 }
487
488 jboolean IsCapturingScreen(JNIEnv* env,
489 const JavaParamRef<jclass>& clazz,
490 const JavaParamRef<jobject>& java_web_contents) {
491 content::WebContents* web_contents =
492 content::WebContents::FromJavaWebContents(java_web_contents);
493 scoped_refptr<MediaStreamCaptureIndicator> indicator =
494 MediaCaptureDevicesDispatcher::GetInstance()
495 ->GetMediaStreamCaptureIndicator();
496 return indicator->IsBeingMirrored(web_contents);
497 }
498
499 void NotifyStopped(JNIEnv* env,
500 const JavaParamRef<jclass>& clazz,
501 const JavaParamRef<jobject>& java_web_contents) {
502 content::WebContents* web_contents =
503 content::WebContents::FromJavaWebContents(java_web_contents);
Ted C 2016/08/16 00:19:19 Any chance (in a follow up), you can pull these fo
braveyao 2016/08/16 23:05:49 Sure.
504 scoped_refptr<MediaStreamCaptureIndicator> indicator =
505 MediaCaptureDevicesDispatcher::GetInstance()
506 ->GetMediaStreamCaptureIndicator();
507 indicator->NotifyStopped(web_contents);
508 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698