Chromium Code Reviews| 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 7a04a5d2f522a7dc66ad7f9d8778833dac44103c..db3e94b138afb97dc3715d608cc147099aaa081c 100644 |
| --- a/chrome/browser/extensions/extension_uninstall_dialog.cc |
| +++ b/chrome/browser/extensions/extension_uninstall_dialog.cc |
| @@ -30,13 +30,8 @@ |
| namespace { |
| -// Returns pixel size under maximal scale factor for the icon whose device |
| -// independent size is |size_in_dip| |
| -int GetSizeForMaxScaleFactor(int size_in_dip) { |
| - float max_scale_factor_scale = gfx::ImageSkia::GetMaxSupportedScale(); |
| - |
| - return static_cast<int>(size_in_dip * max_scale_factor_scale); |
| -} |
| +// Size of extension icon in top left of dialog. |
| +const int kIconSize = 64; |
| // Returns bitmap for the default icon with size equal to the default icon's |
| // pixel size under maximal supported scale factor. |
| @@ -50,9 +45,6 @@ SkBitmap GetDefaultIconBitmapForMaxScaleFactor(bool is_app) { |
| } // namespace |
| -// Size of extension icon in top left of dialog. |
| -static const int kIconSize = 69; |
| - |
| ExtensionUninstallDialog::ExtensionUninstallDialog( |
| Profile* profile, |
| Browser* browser, |
| @@ -85,28 +77,28 @@ void ExtensionUninstallDialog::ConfirmUninstall( |
| const extensions::Extension* extension) { |
| DCHECK(ui_loop_ == base::MessageLoop::current()); |
| extension_ = extension; |
| - // Bookmark apps may not have 128x128 icons so accept 48x48 icons. |
| - const int icon_size = extension_->from_bookmark() |
| - ? extension_misc::EXTENSION_ICON_MEDIUM |
| - : extension_misc::EXTENSION_ICON_LARGE; |
|
calamity
2014/05/30 06:42:03
On second thought, I think we need to keep this fo
sashab
2014/05/30 07:20:46
Done.
|
| + |
| extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource( |
| extension_, |
| - icon_size, |
| + kIconSize, |
| 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); |
| // Load the image asynchronously. The response will be sent to OnImageLoaded. |
| state_ = kImageIsLoading; |
| extensions::ImageLoader* loader = |
| extensions::ImageLoader::Get(profile_); |
| - loader->LoadImageAsync(extension_, |
| - image, |
| - gfx::Size(pixel_size, pixel_size), |
| - base::Bind(&ExtensionUninstallDialog::OnImageLoaded, |
| - AsWeakPtr(), |
| - extension_->id())); |
| + |
| + std::vector<extensions::ImageLoader::ImageRepresentation> images_list; |
| + images_list.push_back(extensions::ImageLoader::ImageRepresentation( |
| + image, |
| + extensions::ImageLoader::ImageRepresentation::NEVER_RESIZE, |
| + gfx::Size(), |
| + ui::SCALE_FACTOR_100P)); |
| + loader->LoadImagesAsync(extension_, |
| + images_list, |
| + base::Bind(&ExtensionUninstallDialog::OnImageLoaded, |
| + AsWeakPtr(), |
| + extension_->id())); |
| } |
| void ExtensionUninstallDialog::SetIcon(const gfx::Image& image) { |