| 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/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/app/chrome_command_ids.h" | 10 #include "chrome/app/chrome_command_ids.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 EnsureStatusTrayIcon(); | 152 EnsureStatusTrayIcon(); |
| 153 DCHECK(!tray_image_.empty()); | 153 DCHECK(!tray_image_.empty()); |
| 154 DCHECK(!balloon_image_.empty()); | 154 DCHECK(!balloon_image_.empty()); |
| 155 | 155 |
| 156 status_icon_->SetImage(tray_image_); | 156 status_icon_->SetImage(tray_image_); |
| 157 } | 157 } |
| 158 | 158 |
| 159 void MediaStreamCaptureIndicator::EnsureStatusTrayIcon() { | 159 void MediaStreamCaptureIndicator::EnsureStatusTrayIcon() { |
| 160 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 160 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 161 if (tray_image_.empty()) { | 161 if (tray_image_.empty()) { |
| 162 tray_image_ = *ResourceBundle::GetSharedInstance().GetBitmapNamed( | 162 tray_image_ = *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 163 IDR_MEDIA_STREAM_CAPTURE_LED); | 163 IDR_MEDIA_STREAM_CAPTURE_LED); |
| 164 } | 164 } |
| 165 if (balloon_image_.empty()) { | 165 if (balloon_image_.empty()) { |
| 166 balloon_image_ = *ResourceBundle::GetSharedInstance().GetBitmapNamed( | 166 balloon_image_ = *ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 167 IDR_PRODUCT_LOGO_32); | 167 IDR_PRODUCT_LOGO_32); |
| 168 } | 168 } |
| 169 } | 169 } |
| 170 | 170 |
| 171 void MediaStreamCaptureIndicator::ShowBalloon( | 171 void MediaStreamCaptureIndicator::ShowBalloon( |
| 172 int render_process_id, | 172 int render_process_id, |
| 173 int render_view_id, | 173 int render_view_id, |
| 174 bool audio, | 174 bool audio, |
| 175 bool video) const { | 175 bool video) const { |
| 176 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 176 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 | 360 |
| 361 // Remove the last character if it is a '/'. | 361 // Remove the last character if it is a '/'. |
| 362 if (!security_origin.empty()) { | 362 if (!security_origin.empty()) { |
| 363 std::string::iterator it = security_origin.end() - 1; | 363 std::string::iterator it = security_origin.end() - 1; |
| 364 if (*it == '/') | 364 if (*it == '/') |
| 365 security_origin.erase(it); | 365 security_origin.erase(it); |
| 366 } | 366 } |
| 367 | 367 |
| 368 return UTF8ToUTF16(security_origin); | 368 return UTF8ToUTF16(security_origin); |
| 369 } | 369 } |
| OLD | NEW |