| 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<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 Loading... |
| 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 |
| OLD | NEW |