| 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/media/webrtc/media_stream_capture_indicator.h" | 5 #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 base::WeakPtr<WebContentsDeviceUsage> device_usage_; | 168 base::WeakPtr<WebContentsDeviceUsage> device_usage_; |
| 169 content::MediaStreamDevices devices_; | 169 content::MediaStreamDevices devices_; |
| 170 bool started_; | 170 bool started_; |
| 171 | 171 |
| 172 DISALLOW_COPY_AND_ASSIGN(UIDelegate); | 172 DISALLOW_COPY_AND_ASSIGN(UIDelegate); |
| 173 }; | 173 }; |
| 174 | 174 |
| 175 std::unique_ptr<content::MediaStreamUI> | 175 std::unique_ptr<content::MediaStreamUI> |
| 176 MediaStreamCaptureIndicator::WebContentsDeviceUsage::RegisterMediaStream( | 176 MediaStreamCaptureIndicator::WebContentsDeviceUsage::RegisterMediaStream( |
| 177 const content::MediaStreamDevices& devices) { | 177 const content::MediaStreamDevices& devices) { |
| 178 return base::WrapUnique(new UIDelegate(weak_factory_.GetWeakPtr(), devices)); | 178 return base::MakeUnique<UIDelegate>(weak_factory_.GetWeakPtr(), devices); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void MediaStreamCaptureIndicator::WebContentsDeviceUsage::AddDevices( | 181 void MediaStreamCaptureIndicator::WebContentsDeviceUsage::AddDevices( |
| 182 const content::MediaStreamDevices& devices) { | 182 const content::MediaStreamDevices& devices) { |
| 183 for (content::MediaStreamDevices::const_iterator it = devices.begin(); | 183 for (content::MediaStreamDevices::const_iterator it = devices.begin(); |
| 184 it != devices.end(); ++it) { | 184 it != devices.end(); ++it) { |
| 185 if (it->type == content::MEDIA_TAB_AUDIO_CAPTURE || | 185 if (it->type == content::MEDIA_TAB_AUDIO_CAPTURE || |
| 186 it->type == content::MEDIA_TAB_VIDEO_CAPTURE) { | 186 it->type == content::MEDIA_TAB_VIDEO_CAPTURE) { |
| 187 ++mirroring_ref_count_; | 187 ++mirroring_ref_count_; |
| 188 } else if (content::IsAudioInputMediaType(it->type)) { | 188 } else if (content::IsAudioInputMediaType(it->type)) { |
| (...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 } else if (audio && !video) { | 432 } else if (audio && !video) { |
| 433 message_id = IDS_MEDIA_STREAM_STATUS_TRAY_TEXT_AUDIO_ONLY; | 433 message_id = IDS_MEDIA_STREAM_STATUS_TRAY_TEXT_AUDIO_ONLY; |
| 434 *image = *mic_image_; | 434 *image = *mic_image_; |
| 435 } else if (!audio && video) { | 435 } else if (!audio && video) { |
| 436 message_id = IDS_MEDIA_STREAM_STATUS_TRAY_TEXT_VIDEO_ONLY; | 436 message_id = IDS_MEDIA_STREAM_STATUS_TRAY_TEXT_VIDEO_ONLY; |
| 437 *image = *camera_image_; | 437 *image = *camera_image_; |
| 438 } | 438 } |
| 439 | 439 |
| 440 *tool_tip = l10n_util::GetStringUTF16(message_id); | 440 *tool_tip = l10n_util::GetStringUTF16(message_id); |
| 441 } | 441 } |
| OLD | NEW |