diff options
author | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-16 00:08:28 +0000 |
---|---|---|
committer | pkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-16 00:08:28 +0000 |
commit | 1e61a9f8cd916315b99872399d6a9a9196d807b5 (patch) | |
tree | f21fea71c849abeb4e3f842ee6adf12b5a49b9aa /chrome/browser/extensions/extension_install_prompt.cc | |
parent | 08d06fa11cbf9fb37800d99f97b6df529bc23c10 (diff) | |
download | chromium_src-1e61a9f8cd916315b99872399d6a9a9196d807b5.zip chromium_src-1e61a9f8cd916315b99872399d6a9a9196d807b5.tar.gz chromium_src-1e61a9f8cd916315b99872399d6a9a9196d807b5.tar.bz2 |
Revert 168079 - This CL ensures that favicons always
1) Stores a 1x representation in history
2) Returns a 1x representation upon calling FaviconService::GetFaviconImageForURL() such that the 1x favicon can be pushed to sync.
BUG=160503
Test=Manual, see instructions below
1) Go to http://www.corp.google.com/~pkotwicz/favicon_small_big/test.html on an iOS device and bookmark it. On the iOS device, the favicon should be red.
2) On a windows device, make sure that the favicon which is received via sync is blue
Review URL: https://chromiumcodereview.appspot.com/11360233
TBR=pkotwicz@chromium.org
Review URL: https://codereview.chromium.org/11418021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@168088 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_install_prompt.cc')
-rw-r--r-- | chrome/browser/extensions/extension_install_prompt.cc | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/chrome/browser/extensions/extension_install_prompt.cc b/chrome/browser/extensions/extension_install_prompt.cc index a664fe5..dff6daa 100644 --- a/chrome/browser/extensions/extension_install_prompt.cc +++ b/chrome/browser/extensions/extension_install_prompt.cc @@ -104,16 +104,26 @@ 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) { - float max_scale_factor_scale = - ui::GetScaleFactorScale(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); } // 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 Extension::GetDefaultIcon(is_app). - GetRepresentation(ui::GetMaxScaleFactor()).sk_bitmap(); + GetRepresentation(max_scale_factor).sk_bitmap(); } // If auto confirm is enabled then posts a task to proceed with or cancel the |