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

Side by Side Diff: chrome/browser/ui/tabs/tab_utils.cc

Issue 12153002: Move chrome://media-internals to content. This allows us to hide implementation details from the pu… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/ui/tabs/tab_utils.h" 5 #include "chrome/browser/ui/tabs/tab_utils.h"
6 6
7 #include "chrome/browser/media/media_internals.h" 7 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
8 #include "chrome/browser/media/media_stream_capture_indicator.h" 8 #include "chrome/browser/media/media_stream_capture_indicator.h"
9 #include "content/public/browser/render_process_host.h" 9 #include "content/public/browser/render_process_host.h"
10 #include "content/public/browser/render_view_host.h" 10 #include "content/public/browser/render_view_host.h"
11 #include "content/public/browser/web_contents.h" 11 #include "content/public/browser/web_contents.h"
12 12
13 namespace chrome { 13 namespace chrome {
14 14
15 bool ShouldShowProjectingIndicator(content::WebContents* contents) { 15 bool ShouldShowProjectingIndicator(content::WebContents* contents) {
16 int render_process_id = contents->GetRenderProcessHost()->GetID(); 16 int render_process_id = contents->GetRenderProcessHost()->GetID();
17 int render_view_id = contents->GetRenderViewHost()->GetRoutingID(); 17 int render_view_id = contents->GetRenderViewHost()->GetRoutingID();
18 scoped_refptr<MediaStreamCaptureIndicator> indicator = 18 scoped_refptr<MediaStreamCaptureIndicator> indicator =
19 MediaInternals::GetInstance()->GetMediaStreamCaptureIndicator(); 19 MediaCaptureDevicesDispatcher::GetInstance()->
20 GetMediaStreamCaptureIndicator();
20 return indicator->IsBeingMirrored(render_process_id, render_view_id); 21 return indicator->IsBeingMirrored(render_process_id, render_view_id);
21 } 22 }
22 23
23 bool ShouldShowRecordingIndicator(content::WebContents* contents) { 24 bool ShouldShowRecordingIndicator(content::WebContents* contents) {
24 int render_process_id = contents->GetRenderProcessHost()->GetID(); 25 int render_process_id = contents->GetRenderProcessHost()->GetID();
25 int render_view_id = contents->GetRenderViewHost()->GetRoutingID(); 26 int render_view_id = contents->GetRenderViewHost()->GetRoutingID();
26 scoped_refptr<MediaStreamCaptureIndicator> indicator = 27 scoped_refptr<MediaStreamCaptureIndicator> indicator =
27 MediaInternals::GetInstance()->GetMediaStreamCaptureIndicator(); 28 MediaCaptureDevicesDispatcher::GetInstance()->
29 GetMediaStreamCaptureIndicator();
28 // The projecting indicator takes precedence over the recording indicator, but 30 // The projecting indicator takes precedence over the recording indicator, but
29 // if we are projecting and we don't handle the projecting case we want to 31 // if we are projecting and we don't handle the projecting case we want to
30 // still show the recording indicator. 32 // still show the recording indicator.
31 return indicator->IsCapturingUserMedia(render_process_id, render_view_id) || 33 return indicator->IsCapturingUserMedia(render_process_id, render_view_id) ||
32 indicator->IsBeingMirrored(render_process_id, render_view_id); 34 indicator->IsBeingMirrored(render_process_id, render_view_id);
33 } 35 }
34 36
35 } // namespace chrome 37 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698