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

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

Issue 335233003: Convert ui::ScaleFactor -> float in favicon/history code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix size_t Created 6 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/favicon/favicon_handler.cc » ('j') | chrome/browser/favicon/favicon_handler.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_web_ui.cc
diff --git a/chrome/browser/extensions/extension_web_ui.cc b/chrome/browser/extensions/extension_web_ui.cc
index 21b2b10256e5034c1ebc36277153d66e25d1b47c..4b395dcf778c0a6b715a8c9d395dc0f7115fd3aa 100644
--- a/chrome/browser/extensions/extension_web_ui.cc
+++ b/chrome/browser/extensions/extension_web_ui.cc
@@ -424,23 +424,22 @@ void ExtensionWebUI::GetFaviconForURL(
// resources. Load image reps for all supported scale factors (in addition to
// 1x) immediately instead of in an as needed fashion to be consistent with
// how favicons are requested for chrome:// and page URLs.
- const std::vector<ui::ScaleFactor>& scale_factors =
- favicon_base::GetFaviconScaleFactors();
+ const std::vector<float>& favicon_scales = favicon_base::GetFaviconScales();
std::vector<extensions::ImageLoader::ImageRepresentation> info_list;
- for (size_t i = 0; i < scale_factors.size(); ++i) {
- float scale = ui::GetScaleForScaleFactor(scale_factors[i]);
+ for (size_t i = 0; i < favicon_scales.size(); ++i) {
+ float scale = favicon_scales[i];
int pixel_size = static_cast<int>(gfx::kFaviconSize * scale);
extensions::ExtensionResource icon_resource =
extensions::IconsInfo::GetIconResource(extension,
pixel_size,
ExtensionIconSet::MATCH_BIGGER);
- info_list.push_back(
- extensions::ImageLoader::ImageRepresentation(
- icon_resource,
- extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE,
- gfx::Size(pixel_size, pixel_size),
- scale_factors[i]));
+ ui::ScaleFactor resource_scale_factor = ui::GetSupportedScaleFactor(scale);
+ info_list.push_back(extensions::ImageLoader::ImageRepresentation(
+ icon_resource,
+ extensions::ImageLoader::ImageRepresentation::ALWAYS_RESIZE,
+ gfx::Size(pixel_size, pixel_size),
+ resource_scale_factor));
}
// LoadImagesAsync actually can run callback synchronously. We want to force
« no previous file with comments | « no previous file | chrome/browser/favicon/favicon_handler.cc » ('j') | chrome/browser/favicon/favicon_handler.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698