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

Side by Side Diff: chrome/browser/extensions/tab_helper.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/extensions/tab_helper.h" 5 #include "chrome/browser/extensions/tab_helper.h"
6 6
7 #include "chrome/browser/extensions/activity_log.h" 7 #include "chrome/browser/extensions/activity_log.h"
8 #include "chrome/browser/extensions/app_notify_channel_ui.h" 8 #include "chrome/browser/extensions/app_notify_channel_ui.h"
9 #include "chrome/browser/extensions/crx_installer.h" 9 #include "chrome/browser/extensions/crx_installer.h"
10 #include "chrome/browser/extensions/extension_action.h" 10 #include "chrome/browser/extensions/extension_action.h"
11 #include "chrome/browser/extensions/extension_action_manager.h" 11 #include "chrome/browser/extensions/extension_action_manager.h"
12 #include "chrome/browser/extensions/extension_service.h" 12 #include "chrome/browser/extensions/extension_service.h"
13 #include "chrome/browser/extensions/extension_tab_util.h" 13 #include "chrome/browser/extensions/extension_tab_util.h"
14 #include "chrome/browser/extensions/page_action_controller.h" 14 #include "chrome/browser/extensions/page_action_controller.h"
15 #include "chrome/browser/extensions/script_badge_controller.h" 15 #include "chrome/browser/extensions/script_badge_controller.h"
16 #include "chrome/browser/extensions/script_bubble_controller.h" 16 #include "chrome/browser/extensions/script_bubble_controller.h"
17 #include "chrome/browser/extensions/script_executor.h" 17 #include "chrome/browser/extensions/script_executor.h"
18 #include "chrome/browser/extensions/webstore_standalone_installer.h" 18 #include "chrome/browser/extensions/webstore_standalone_installer.h"
19 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/sessions/session_id.h" 20 #include "chrome/browser/sessions/session_id.h"
21 #include "chrome/browser/sessions/session_tab_helper.h" 21 #include "chrome/browser/sessions/session_tab_helper.h"
22 #include "chrome/browser/ui/browser_dialogs.h" 22 #include "chrome/browser/ui/browser_dialogs.h"
23 #include "chrome/browser/ui/web_applications/web_app_ui.h" 23 #include "chrome/browser/ui/web_applications/web_app_ui.h"
24 #include "chrome/browser/web_applications/web_app.h" 24 #include "chrome/browser/web_applications/web_app.h"
25 #include "chrome/common/chrome_notification_types.h" 25 #include "chrome/common/chrome_notification_types.h"
26 #include "chrome/common/extensions/api/icons/icons_handler.h"
26 #include "chrome/common/extensions/extension.h" 27 #include "chrome/common/extensions/extension.h"
27 #include "chrome/common/extensions/extension_constants.h" 28 #include "chrome/common/extensions/extension_constants.h"
28 #include "chrome/common/extensions/extension_icon_set.h" 29 #include "chrome/common/extensions/extension_icon_set.h"
29 #include "chrome/common/extensions/extension_messages.h" 30 #include "chrome/common/extensions/extension_messages.h"
30 #include "chrome/common/extensions/extension_resource.h" 31 #include "chrome/common/extensions/extension_resource.h"
31 #include "chrome/common/extensions/feature_switch.h" 32 #include "chrome/common/extensions/feature_switch.h"
32 #include "content/public/browser/invalidate_type.h" 33 #include "content/public/browser/invalidate_type.h"
33 #include "content/public/browser/navigation_controller.h" 34 #include "content/public/browser/navigation_controller.h"
34 #include "content/public/browser/navigation_details.h" 35 #include "content/public/browser/navigation_details.h"
35 #include "content/public/browser/navigation_entry.h" 36 #include "content/public/browser/navigation_entry.h"
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 return extension; 429 return extension;
429 } 430 }
430 431
431 void TabHelper::UpdateExtensionAppIcon(const Extension* extension) { 432 void TabHelper::UpdateExtensionAppIcon(const Extension* extension) {
432 extension_app_icon_.reset(); 433 extension_app_icon_.reset();
433 434
434 if (extension) { 435 if (extension) {
435 extension_app_image_loader_.reset(new ImageLoadingTracker(this)); 436 extension_app_image_loader_.reset(new ImageLoadingTracker(this));
436 extension_app_image_loader_->LoadImage( 437 extension_app_image_loader_->LoadImage(
437 extension, 438 extension,
438 extension->GetIconResource(extension_misc::EXTENSION_ICON_SMALLISH, 439 IconsInfo::GetIconResource(extension,
440 extension_misc::EXTENSION_ICON_SMALLISH,
439 ExtensionIconSet::MATCH_EXACTLY), 441 ExtensionIconSet::MATCH_EXACTLY),
440 gfx::Size(extension_misc::EXTENSION_ICON_SMALLISH, 442 gfx::Size(extension_misc::EXTENSION_ICON_SMALLISH,
441 extension_misc::EXTENSION_ICON_SMALLISH), 443 extension_misc::EXTENSION_ICON_SMALLISH),
442 ImageLoadingTracker::CACHE); 444 ImageLoadingTracker::CACHE);
443 } else { 445 } else {
444 extension_app_image_loader_.reset(NULL); 446 extension_app_image_loader_.reset(NULL);
445 } 447 }
446 } 448 }
447 449
448 void TabHelper::SetAppIcon(const SkBitmap& app_icon) { 450 void TabHelper::SetAppIcon(const SkBitmap& app_icon) {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 script_bubble_controller_->OnExtensionUnloaded( 514 script_bubble_controller_->OnExtensionUnloaded(
513 content::Details<extensions::UnloadedExtensionInfo>( 515 content::Details<extensions::UnloadedExtensionInfo>(
514 details)->extension->id()); 516 details)->extension->id());
515 break; 517 break;
516 } 518 }
517 } 519 }
518 } 520 }
519 } 521 }
520 522
521 } // namespace extensions 523 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698