Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: chrome/browser/media/media_stream_capture_indicator.cc

Issue 11786003: Move Icons out of Extension class (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_browser_action
Patch Set: Latest master + Yoyo's requests Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 277
277 WebContents* web_contents = tab_util::GetWebContentsByID( 278 WebContents* web_contents = tab_util::GetWebContentsByID(
278 render_process_id, render_view_id); 279 render_process_id, render_view_id);
279 280
280 Profile* profile = 281 Profile* profile =
281 Profile::FromBrowserContext(web_contents->GetBrowserContext()); 282 Profile::FromBrowserContext(web_contents->GetBrowserContext());
282 283
283 should_show_balloon_ = true; 284 should_show_balloon_ = true;
284 extensions::ImageLoader::Get(profile)->LoadImageAsync( 285 extensions::ImageLoader::Get(profile)->LoadImageAsync(
285 extension, 286 extension,
286 extension->GetIconResource(32, ExtensionIconSet::MATCH_BIGGER), 287 extensions::IconsInfo::GetIconResource(
288 extension, 32, ExtensionIconSet::MATCH_BIGGER),
287 gfx::Size(32, 32), 289 gfx::Size(32, 32),
288 base::Bind(&MediaStreamCaptureIndicator::OnImageLoaded, 290 base::Bind(&MediaStreamCaptureIndicator::OnImageLoaded,
289 this, message)); 291 this, message));
290 return; 292 return;
291 } 293 }
292 294
293 string16 title = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); 295 string16 title = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME);
294 string16 body = l10n_util::GetStringFUTF16(message_id, 296 string16 body = l10n_util::GetStringFUTF16(message_id,
295 GetSecurityOrigin(render_process_id, render_view_id)); 297 GetSecurityOrigin(render_process_id, render_view_id));
296 status_icon_->DisplayBalloon(*balloon_image_, title, body); 298 status_icon_->DisplayBalloon(*balloon_image_, title, body);
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 return false; 516 return false;
515 517
516 CaptureDeviceTabs::const_iterator iter = std::find_if( 518 CaptureDeviceTabs::const_iterator iter = std::find_if(
517 tabs_.begin(), tabs_.end(), TabEquals(web_contents, 519 tabs_.begin(), tabs_.end(), TabEquals(web_contents,
518 render_process_id, 520 render_process_id,
519 render_view_id)); 521 render_view_id));
520 if (iter == tabs_.end()) 522 if (iter == tabs_.end())
521 return false; 523 return false;
522 return (iter->tab_capture_ref_count > 0); 524 return (iter->tab_capture_ref_count > 0);
523 } 525 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698