| 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/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/app/chrome_command_ids.h" | 11 #include "chrome/app/chrome_command_ids.h" |
| 12 #include "chrome/browser/browser_process.h" | 12 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
| 14 #include "chrome/browser/extensions/image_loader.h" | 14 #include "chrome/browser/extensions/image_loader.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/status_icons/status_icon.h" | 16 #include "chrome/browser/status_icons/status_icon.h" |
| 17 #include "chrome/browser/status_icons/status_tray.h" | 17 #include "chrome/browser/status_icons/status_tray.h" |
| 18 #include "chrome/browser/tab_contents/tab_util.h" | 18 #include "chrome/browser/tab_contents/tab_util.h" |
| 19 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 19 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
| 20 #include "content/public/browser/content_browser_client.h" | 21 #include "content/public/browser/content_browser_client.h" |
| 21 #include "content/public/browser/invalidate_type.h" | 22 #include "content/public/browser/invalidate_type.h" |
| 22 #include "content/public/browser/render_view_host.h" | 23 #include "content/public/browser/render_view_host.h" |
| 23 #include "content/public/browser/web_contents.h" | 24 #include "content/public/browser/web_contents.h" |
| 24 #include "content/public/browser/web_contents_delegate.h" | 25 #include "content/public/browser/web_contents_delegate.h" |
| 25 #include "content/public/common/media_stream_request.h" | 26 #include "content/public/common/media_stream_request.h" |
| 26 #include "grit/chromium_strings.h" | 27 #include "grit/chromium_strings.h" |
| 27 #include "grit/generated_resources.h" | 28 #include "grit/generated_resources.h" |
| 28 #include "grit/theme_resources.h" | 29 #include "grit/theme_resources.h" |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 | 282 |
| 282 WebContents* web_contents = tab_util::GetWebContentsByID( | 283 WebContents* web_contents = tab_util::GetWebContentsByID( |
| 283 render_process_id, render_view_id); | 284 render_process_id, render_view_id); |
| 284 | 285 |
| 285 Profile* profile = | 286 Profile* profile = |
| 286 Profile::FromBrowserContext(web_contents->GetBrowserContext()); | 287 Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
| 287 | 288 |
| 288 should_show_balloon_ = true; | 289 should_show_balloon_ = true; |
| 289 extensions::ImageLoader::Get(profile)->LoadImageAsync( | 290 extensions::ImageLoader::Get(profile)->LoadImageAsync( |
| 290 extension, | 291 extension, |
| 291 extension->GetIconResource(32, ExtensionIconSet::MATCH_BIGGER), | 292 extensions::IconsInfo::GetIconResource( |
| 293 extension, 32, ExtensionIconSet::MATCH_BIGGER), |
| 292 gfx::Size(32, 32), | 294 gfx::Size(32, 32), |
| 293 base::Bind(&MediaStreamCaptureIndicator::OnImageLoaded, | 295 base::Bind(&MediaStreamCaptureIndicator::OnImageLoaded, |
| 294 this, message)); | 296 this, message)); |
| 295 } | 297 } |
| 296 | 298 |
| 297 void MediaStreamCaptureIndicator::OnImageLoaded( | 299 void MediaStreamCaptureIndicator::OnImageLoaded( |
| 298 const string16& message, | 300 const string16& message, |
| 299 const gfx::Image& image) { | 301 const gfx::Image& image) { |
| 300 if (!should_show_balloon_) | 302 if (!should_show_balloon_) |
| 301 return; | 303 return; |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 return false; | 514 return false; |
| 513 | 515 |
| 514 CaptureDeviceTabs::const_iterator iter = std::find_if( | 516 CaptureDeviceTabs::const_iterator iter = std::find_if( |
| 515 tabs_.begin(), tabs_.end(), TabEquals(web_contents, | 517 tabs_.begin(), tabs_.end(), TabEquals(web_contents, |
| 516 render_process_id, | 518 render_process_id, |
| 517 render_view_id)); | 519 render_view_id)); |
| 518 if (iter == tabs_.end()) | 520 if (iter == tabs_.end()) |
| 519 return false; | 521 return false; |
| 520 return (iter->tab_capture_ref_count > 0); | 522 return (iter->tab_capture_ref_count > 0); |
| 521 } | 523 } |
| OLD | NEW |