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

Unified Diff: chrome/browser/extensions/extension_install_prompt.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_install_prompt.cc
diff --git a/chrome/browser/extensions/extension_install_prompt.cc b/chrome/browser/extensions/extension_install_prompt.cc
index 809b01a6548fd0649773bad1c0b3b390a82107d4..f02d35a8e7949c7cde91228bc3ca1538bd0a740a 100644
--- a/chrome/browser/extensions/extension_install_prompt.cc
+++ b/chrome/browser/extensions/extension_install_prompt.cc
@@ -119,15 +119,6 @@ static const int
IDS_EXTENSION_PROMPT_WILL_HAVE_ACCESS_TO,
};
-// Size of extension icon in top left of dialog.
-const int kIconSize = 69;
-
-// Returns pixel size under maximal scale factor for the icon whose device
-// independent size is |size_in_dip|
-int GetSizeForMaxScaleFactor(int size_in_dip) {
- return static_cast<int>(size_in_dip * gfx::ImageSkia::GetMaxSupportedScale());
-}
-
// 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) {
@@ -690,18 +681,24 @@ void ExtensionInstallPrompt::LoadImageIfNeeded() {
return;
}
- // Load the image asynchronously. For the response, check OnImageLoaded.
extensions::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.
- // TODO(tbarzic): We should use IconImage here and load the required bitmap
- // lazily.
- int pixel_size = GetSizeForMaxScaleFactor(kIconSize);
- extensions::ImageLoader::Get(install_ui_->profile())->LoadImageAsync(
- extension_, image, gfx::Size(pixel_size, pixel_size),
+
+ // Load the image asynchronously. The response will be sent to OnImageLoaded.
+ extensions::ImageLoader* loader =
+ extensions::ImageLoader::Get(install_ui_->profile());
+
+ std::vector<extensions::ImageLoader::ImageRepresentation> images_list;
+ images_list.push_back(extensions::ImageLoader::ImageRepresentation(
+ image,
+ extensions::ImageLoader::ImageRepresentation::NEVER_RESIZE,
benwells 2014/06/02 06:07:02 Sorry if you've already been asked these questions
sashab 2014/06/03 01:17:32 If there is no appropriate image, OnImageLoaded()
+ gfx::Size(),
+ ui::SCALE_FACTOR_100P));
benwells 2014/06/02 06:07:02 What does this scale factor mean exactly? In parti
sashab 2014/06/03 01:17:32 If you look at ImageLoader::LoadImageAsync() (the
+ loader->LoadImagesAsync(
+ extension_,
+ images_list,
base::Bind(&ExtensionInstallPrompt::OnImageLoaded, AsWeakPtr()));
}
« no previous file with comments | « chrome/app/nibs/ExtensionInstallPromptWebstoreData.xib ('k') | chrome/browser/extensions/extension_uninstall_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698