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

Side by Side Diff: chrome/browser/ui/views/ash/launcher/launcher_favicon_loader.cc

Issue 10828127: Use hi-resolution favicon variants if available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: daringfireball hackfix Created 8 years, 4 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 (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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698