OLD | NEW |
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 Loading... |
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<int> requested_sizes_in_pixel; |
106 scale_factors.push_back(ui::SCALE_FACTOR_100P); | 106 requested_sizes_in_pixel.push_back(requested_size); |
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 requested_sizes_in_pixel, |
111 requested_size, | |
112 &closest_indices, | 111 &closest_indices, |
113 NULL); | 112 NULL); |
114 | 113 |
115 SkBitmap bitmap; | 114 SkBitmap bitmap; |
116 if (!bitmaps.empty()) { | 115 if (!bitmaps.empty()) { |
117 size_t closest_index = closest_indices[0]; | 116 size_t closest_index = closest_indices[0]; |
118 bitmap = bitmaps[closest_index]; | 117 bitmap = bitmaps[closest_index]; |
119 } | 118 } |
120 | 119 |
121 if (!bitmap.isNull()) { | 120 if (!bitmap.isNull()) { |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 base::Unretained(this))); | 236 base::Unretained(this))); |
238 } | 237 } |
239 } | 238 } |
240 | 239 |
241 void UpdateShortcutWorker::DeleteMeOnUIThread() { | 240 void UpdateShortcutWorker::DeleteMeOnUIThread() { |
242 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 241 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
243 delete this; | 242 delete this; |
244 } | 243 } |
245 | 244 |
246 } // namespace web_app | 245 } // namespace web_app |
OLD | NEW |