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

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

Issue 11418021: Revert 168079 - This CL ensures that favicons always (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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
===================================================================
--- chrome/browser/extensions/extension_uninstall_dialog.cc (revision 168086)
+++ chrome/browser/extensions/extension_uninstall_dialog.cc (working copy)
@@ -23,7 +23,10 @@
// Returns pixel size under maximal scale factor for the icon whose device
// independent size is |size_in_dip|
int GetSizeForMaxScaleFactor(int size_in_dip) {
- ui::ScaleFactor max_scale_factor = ui::GetMaxScaleFactor();
+ std::vector<ui::ScaleFactor> supported_scale_factors =
+ ui::GetSupportedScaleFactors();
+ // Scale factors are in ascending order, so the last one is the one we need.
+ ui::ScaleFactor max_scale_factor = supported_scale_factors.back();
float max_scale_factor_scale = ui::GetScaleFactorScale(max_scale_factor);
return static_cast<int>(size_in_dip * max_scale_factor_scale);
@@ -32,8 +35,14 @@
// 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) {
+ std::vector<ui::ScaleFactor> supported_scale_factors =
+ ui::GetSupportedScaleFactors();
+ // Scale factors are in ascending order, so the last one is the one we need.
+ ui::ScaleFactor max_scale_factor =
+ supported_scale_factors[supported_scale_factors.size() - 1];
+
return extensions::Extension::GetDefaultIcon(is_app).
- GetRepresentation(ui::GetMaxScaleFactor()).sk_bitmap();
+ GetRepresentation(max_scale_factor).sk_bitmap();
}
} // namespace
« no previous file with comments | « chrome/browser/extensions/extension_install_prompt.cc ('k') | chrome/browser/extensions/extension_web_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698