OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/ash/launcher/launcher_favicon_loader.h" | 5 #include "chrome/browser/ui/views/ash/launcher/launcher_favicon_loader.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/favicon/favicon_util.h" | 8 #include "chrome/browser/favicon/favicon_util.h" |
9 #include "chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller.
h" | 9 #include "chrome/browser/ui/views/ash/launcher/browser_launcher_item_controller.
h" |
10 #include "chrome/common/favicon_url.h" | 10 #include "chrome/common/favicon_url.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 if (pending_requests_.find(*iter) != pending_requests_.end()) | 102 if (pending_requests_.find(*iter) != pending_requests_.end()) |
103 continue; // Skip already pending downloads. | 103 continue; // Skip already pending downloads. |
104 DownloadFavicon(*iter); | 104 DownloadFavicon(*iter); |
105 } | 105 } |
106 } | 106 } |
107 | 107 |
108 void FaviconBitmapHandler::DownloadFavicon(const GURL& image_url) { | 108 void FaviconBitmapHandler::DownloadFavicon(const GURL& image_url) { |
109 int image_size = 0; // Request the full sized image. | 109 int image_size = 0; // Request the full sized image. |
110 pending_requests_.insert(image_url); | 110 pending_requests_.insert(image_url); |
111 content::RenderViewHost* host = web_contents_->GetRenderViewHost(); | 111 content::RenderViewHost* host = web_contents_->GetRenderViewHost(); |
112 FaviconUtil::DownloadFavicon(host, image_url, image_size); | 112 FaviconUtil::DownloadFavicon(host, image_url, std::vector<int>(1, image_size))
; // XXX |
113 } | 113 } |
114 | 114 |
115 void FaviconBitmapHandler::OnDidDownloadFavicon(int id, | 115 void FaviconBitmapHandler::OnDidDownloadFavicon(int id, |
116 const GURL& image_url, | 116 const GURL& image_url, |
117 bool errored, | 117 bool errored, |
118 const SkBitmap& bitmap) { | 118 const SkBitmap& bitmap) { |
119 UrlSet::iterator iter = pending_requests_.find(image_url); | 119 UrlSet::iterator iter = pending_requests_.find(image_url); |
120 if (iter == pending_requests_.end()) { | 120 if (iter == pending_requests_.end()) { |
121 // Updates are received for all downloads; ignore unrequested urls. | 121 // Updates are received for all downloads; ignore unrequested urls. |
122 return; | 122 return; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 const std::vector<FaviconURL>& candidates) { | 178 const std::vector<FaviconURL>& candidates) { |
179 favicon_handler_->OnUpdateFaviconURL(page_id, candidates); | 179 favicon_handler_->OnUpdateFaviconURL(page_id, candidates); |
180 } | 180 } |
181 | 181 |
182 void LauncherFaviconLoader::OnDidDownloadFavicon(int id, | 182 void LauncherFaviconLoader::OnDidDownloadFavicon(int id, |
183 const GURL& image_url, | 183 const GURL& image_url, |
184 bool errored, | 184 bool errored, |
185 const SkBitmap& bitmap) { | 185 const SkBitmap& bitmap) { |
186 favicon_handler_->OnDidDownloadFavicon(id, image_url, errored, bitmap); | 186 favicon_handler_->OnDidDownloadFavicon(id, image_url, errored, bitmap); |
187 } | 187 } |
OLD | NEW |