| 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/media_stream_capture_indicator.h" | 5 #include "chrome/browser/media/media_stream_capture_indicator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 for (content::MediaStreamDevices::const_iterator it = devices.begin(); | 164 for (content::MediaStreamDevices::const_iterator it = devices.begin(); |
| 165 it != devices.end(); ++it) { | 165 it != devices.end(); ++it) { |
| 166 if (it->type == content::MEDIA_TAB_AUDIO_CAPTURE || | 166 if (it->type == content::MEDIA_TAB_AUDIO_CAPTURE || |
| 167 it->type == content::MEDIA_TAB_VIDEO_CAPTURE) { | 167 it->type == content::MEDIA_TAB_VIDEO_CAPTURE) { |
| 168 ++mirroring_ref_count_; | 168 ++mirroring_ref_count_; |
| 169 } else if (it->type == content::MEDIA_SCREEN_VIDEO_CAPTURE) { | 169 } else if (it->type == content::MEDIA_SCREEN_VIDEO_CAPTURE) { |
| 170 ++screen_capture_ref_count_; | 170 ++screen_capture_ref_count_; |
| 171 stop_screen_capture_callback_ = close_callback; | 171 stop_screen_capture_callback_ = close_callback; |
| 172 } else if (content::IsAudioMediaType(it->type)) { | 172 } else if (content::IsAudioMediaType(it->type)) { |
| 173 ++audio_ref_count_; | 173 ++audio_ref_count_; |
| 174 incremented_audio_count = true; |
| 174 } else if (content::IsVideoMediaType(it->type)) { | 175 } else if (content::IsVideoMediaType(it->type)) { |
| 175 ++video_ref_count_; | 176 ++video_ref_count_; |
| 177 incremented_video_count = true; |
| 176 } else { | 178 } else { |
| 177 NOTIMPLEMENTED(); | 179 NOTIMPLEMENTED(); |
| 178 } | 180 } |
| 179 } | 181 } |
| 180 | 182 |
| 181 if (incremented_audio_count && incremented_video_count) | 183 if (incremented_audio_count && incremented_video_count) |
| 182 return IDS_MEDIA_STREAM_STATUS_TRAY_BALLOON_BODY_AUDIO_AND_VIDEO; | 184 return IDS_MEDIA_STREAM_STATUS_TRAY_BALLOON_BODY_AUDIO_AND_VIDEO; |
| 183 else if (incremented_audio_count) | 185 else if (incremented_audio_count) |
| 184 return IDS_MEDIA_STREAM_STATUS_TRAY_BALLOON_BODY_AUDIO_ONLY; | 186 return IDS_MEDIA_STREAM_STATUS_TRAY_BALLOON_BODY_AUDIO_ONLY; |
| 185 else if (incremented_video_count) | 187 else if (incremented_video_count) |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 592 } | 594 } |
| 593 | 595 |
| 594 UpdateNotificationUserInterface(); | 596 UpdateNotificationUserInterface(); |
| 595 } | 597 } |
| 596 | 598 |
| 597 void MediaStreamCaptureIndicator::OnStopScreenCapture( | 599 void MediaStreamCaptureIndicator::OnStopScreenCapture( |
| 598 const base::Closure& stop) { | 600 const base::Closure& stop) { |
| 599 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 601 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 600 stop.Run(); | 602 stop.Run(); |
| 601 } | 603 } |
| OLD | NEW |