OLD | NEW |
---|---|
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_internals.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> capture_indicator = | 18 scoped_refptr<MediaStreamCaptureIndicator> capture_indicator = |
19 MediaInternals::GetInstance()->GetMediaStreamCaptureIndicator(); | 19 MediaInternals::GetInstance()->GetMediaStreamCaptureIndicator(); |
20 return capture_indicator->IsProcessCapturingTab(render_process_id, | 20 return capture_indicator->IsRenderViewMirroring(render_process_id, |
justinlin
2013/01/23 19:30:43
Hmm, not sure about this naming change. Isn't it a
miu
2013/01/23 20:33:28
Done. I thought a bit more about the naming here.
| |
21 render_view_id); | 21 render_view_id); |
22 } | 22 } |
23 | 23 |
24 bool ShouldShowRecordingIndicator(content::WebContents* contents) { | 24 bool ShouldShowRecordingIndicator(content::WebContents* contents) { |
25 int render_process_id = contents->GetRenderProcessHost()->GetID(); | 25 int render_process_id = contents->GetRenderProcessHost()->GetID(); |
26 int render_view_id = contents->GetRenderViewHost()->GetRoutingID(); | 26 int render_view_id = contents->GetRenderViewHost()->GetRoutingID(); |
27 scoped_refptr<MediaStreamCaptureIndicator> capture_indicator = | 27 scoped_refptr<MediaStreamCaptureIndicator> capture_indicator = |
28 MediaInternals::GetInstance()->GetMediaStreamCaptureIndicator(); | 28 MediaInternals::GetInstance()->GetMediaStreamCaptureIndicator(); |
29 // The projecting indicator takes precedence over the recording indicator, but | 29 // The projecting indicator takes precedence over the recording indicator, but |
30 // if we are projecting and we don't handle the projecting case we want to | 30 // if we are projecting and we don't handle the projecting case we want to |
31 // still show the recording indicator. | 31 // still show the recording indicator. |
32 return capture_indicator->IsProcessCapturing(render_process_id, | 32 return capture_indicator->IsRenderViewCapturing(render_process_id, |
33 render_view_id) || | 33 render_view_id) || |
34 capture_indicator->IsProcessCapturingTab(render_process_id, | 34 capture_indicator->IsRenderViewMirroring(render_process_id, |
35 render_view_id); | 35 render_view_id); |
36 } | 36 } |
37 | 37 |
38 } // namespace chrome | 38 } // namespace chrome |
OLD | NEW |