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

Side by Side Diff: chrome/browser/web_applications/update_shortcut_worker_win.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/web_applications/update_shortcut_worker_win.h" 5 #include "chrome/browser/web_applications/update_shortcut_worker_win.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 unprocessed_icons_.pop_back(); 95 unprocessed_icons_.pop_back();
96 } 96 }
97 97
98 void UpdateShortcutWorker::DidDownloadFavicon( 98 void UpdateShortcutWorker::DidDownloadFavicon(
99 int requested_size, 99 int requested_size,
100 int id, 100 int id,
101 int http_status_code, 101 int http_status_code,
102 const GURL& image_url, 102 const GURL& image_url,
103 const std::vector<SkBitmap>& bitmaps, 103 const std::vector<SkBitmap>& bitmaps,
104 const std::vector<gfx::Size>& original_sizes) { 104 const std::vector<gfx::Size>& original_sizes) {
105 std::vector<ui::ScaleFactor> scale_factors; 105 std::vector<float> favicon_scales;
106 scale_factors.push_back(ui::SCALE_FACTOR_100P); 106 favicon_scales.push_back(1.0f);
107 107
108 std::vector<size_t> closest_indices; 108 std::vector<size_t> closest_indices;
109 SelectFaviconFrameIndices(original_sizes, 109 SelectFaviconFrameIndices(original_sizes,
110 scale_factors, 110 favicon_scales,
111 requested_size, 111 requested_size,
112 &closest_indices, 112 &closest_indices,
113 NULL); 113 NULL);
114 114
115 SkBitmap bitmap; 115 SkBitmap bitmap;
116 if (!bitmaps.empty()) { 116 if (!bitmaps.empty()) {
117 size_t closest_index = closest_indices[0]; 117 size_t closest_index = closest_indices[0];
118 bitmap = bitmaps[closest_index]; 118 bitmap = bitmaps[closest_index];
119 } 119 }
120 120
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 base::Unretained(this))); 237 base::Unretained(this)));
238 } 238 }
239 } 239 }
240 240
241 void UpdateShortcutWorker::DeleteMeOnUIThread() { 241 void UpdateShortcutWorker::DeleteMeOnUIThread() {
242 DCHECK_CURRENTLY_ON(BrowserThread::UI); 242 DCHECK_CURRENTLY_ON(BrowserThread::UI);
243 delete this; 243 delete this;
244 } 244 }
245 245
246 } // namespace web_app 246 } // namespace web_app
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698