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

Unified Diff: chrome/browser/extensions/extension_uninstall_dialog.cc

Issue 301063003: Resized the icon in the Uninstall dialog to be 64x64 px (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit Created 6 years, 7 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 7a04a5d2f522a7dc66ad7f9d8778833dac44103c..ede28c9ebf63695b2e791bfe05a279a39c97fc85 100644
--- a/chrome/browser/extensions/extension_uninstall_dialog.cc
+++ b/chrome/browser/extensions/extension_uninstall_dialog.cc
@@ -30,14 +30,6 @@
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);
-}
-
// 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) {
@@ -50,9 +42,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 +74,31 @@ 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.
+ // Bookmark apps may not have 128x128 icons so accept 64x64 icons.
const int icon_size = extension_->from_bookmark()
- ? extension_misc::EXTENSION_ICON_MEDIUM
- : extension_misc::EXTENSION_ICON_LARGE;
+ ? extension_misc::EXTENSION_ICON_SMALL * 2
+ : extension_misc::EXTENSION_ICON_LARGE;
extensions::ExtensionResource image = extensions::IconsInfo::GetIconResource(
extension_,
icon_size,
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) {

Powered by Google App Engine
This is Rietveld 408576698