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

Unified Diff: chrome/browser/ui/views/create_application_shortcut_view.cc

Issue 335233003: Convert ui::ScaleFactor -> float in favicon/history code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
Index: chrome/browser/ui/views/create_application_shortcut_view.cc
diff --git a/chrome/browser/ui/views/create_application_shortcut_view.cc b/chrome/browser/ui/views/create_application_shortcut_view.cc
index 2b7f0eec2831d2ce2065084f265317316a6af861..1bbdc8f0fc2419c74eed9daddf096ba59410c26f 100644
--- a/chrome/browser/ui/views/create_application_shortcut_view.cc
+++ b/chrome/browser/ui/views/create_application_shortcut_view.cc
@@ -37,7 +37,6 @@
#include "third_party/skia/include/core/SkPaint.h"
#include "third_party/skia/include/core/SkRect.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/codec/png_codec.h"
@@ -494,26 +493,21 @@ void CreateUrlApplicationShortcutView::DidDownloadFavicon(
return;
pending_download_id_ = -1;
- SkBitmap image;
+ SkBitmap bitmap;
if (!bitmaps.empty()) {
- std::vector<ui::ScaleFactor> scale_factors;
- ui::ScaleFactor scale_factor = ui::GetSupportedScaleFactor(
- ui::GetScaleFactorForNativeView(
- web_contents_->GetRenderViewHost()->GetView()->GetNativeView()));
- scale_factors.push_back(scale_factor);
+ std::vector<float> scales;
+ scales.push_back(ui::GetScaleFactorForNativeView(
+ web_contents_->GetRenderViewHost()->GetView()->GetNativeView()));
std::vector<size_t> closest_indices;
- SelectFaviconFrameIndices(original_bitmap_sizes,
- scale_factors,
- requested_size,
- &closest_indices,
- NULL);
+ SelectFaviconFrameIndices(
+ original_bitmap_sizes, scales, requested_size, &closest_indices, NULL);
size_t closest_index = closest_indices[0];
- image = bitmaps[closest_index];
+ bitmap = bitmaps[closest_index];
}
- if (!image.isNull()) {
- shortcut_info_.favicon.Add(gfx::ImageSkia::CreateFrom1xBitmap(image));
+ if (!bitmap.isNull()) {
+ shortcut_info_.favicon.Add(gfx::ImageSkia::CreateFrom1xBitmap(bitmap));
static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon);
} else {
FetchIcon();

Powered by Google App Engine
This is Rietveld 408576698