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

Unified Diff: chrome/browser/extensions/extension_uninstall_dialog.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: Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_uninstall_dialog.cc
diff --git a/chrome/browser/extensions/extension_uninstall_dialog.cc b/chrome/browser/extensions/extension_uninstall_dialog.cc
index 4a0b25cda47062d4b45a6ab0365667365e59931b..f756b454f667166cbe855f340664c6d9e0de9177 100644
--- a/chrome/browser/extensions/extension_uninstall_dialog.cc
+++ b/chrome/browser/extensions/extension_uninstall_dialog.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/extensions/image_loader.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/extensions/api/icons/icons_handler.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_icon_set.h"
@@ -34,8 +35,10 @@ int GetSizeForMaxScaleFactor(int size_in_dip) {
// Returns bitmap for the default icon with size equal to the default icon's
// pixel size under maximal supported scale factor.
SkBitmap GetDefaultIconBitmapForMaxScaleFactor(bool is_app) {
- return extensions::Extension::GetDefaultIcon(is_app).
- GetRepresentation(ui::GetMaxScaleFactor()).sk_bitmap();
+ const gfx::ImageSkia& image = is_app ?
+ extensions::IconsInfo::GetDefaultAppIcon() :
+ extensions::IconsInfo::GetDefaultExtensionIcon();
+ return image.GetRepresentation(ui::GetMaxScaleFactor()).sk_bitmap();
}
} // namespace
@@ -68,10 +71,10 @@ void ExtensionUninstallDialog::ConfirmUninstall(
DCHECK(ui_loop_ == MessageLoop::current());
extension_ = extension;
- ExtensionResource image =
- extension_->GetIconResource(extension_misc::EXTENSION_ICON_LARGE,
- ExtensionIconSet::MATCH_BIGGER);
-
+ ExtensionResource image = extensions::IconsInfo::GetIconResource(
+ extension_,
+ extension_misc::EXTENSION_ICON_LARGE,
+ ExtensionIconSet::MATCH_BIGGER);
// Load the icon whose pixel size is large enough to be displayed under
// maximal supported scale factor. UI code will scale the icon down if needed.
int pixel_size = GetSizeForMaxScaleFactor(kIconSize);

Powered by Google App Engine
This is Rietveld 408576698