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

Side by Side Diff: chrome/browser/favicon/favicon_service.cc

Issue 10908096: webui: Request favicons at all required display scale factors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/resources/downloads/downloads.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/favicon/favicon_service.h" 5 #include "chrome/browser/favicon/favicon_service.h"
6 6
7 #include "chrome/browser/favicon/favicon_util.h" 7 #include "chrome/browser/favicon/favicon_util.h"
8 #include "chrome/browser/favicon/select_favicon_frames.h" 8 #include "chrome/browser/favicon/select_favicon_frames.h"
9 #include "chrome/browser/history/history.h" 9 #include "chrome/browser/history/history.h"
10 #include "chrome/browser/history/history_backend.h" 10 #include "chrome/browser/history/history_backend.h"
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 const GURL& page_url, 204 const GURL& page_url,
205 int icon_types, 205 int icon_types,
206 int desired_size_in_dip, 206 int desired_size_in_dip,
207 const std::vector<ui::ScaleFactor>& desired_scale_factors, 207 const std::vector<ui::ScaleFactor>& desired_scale_factors,
208 CancelableRequestConsumerBase* consumer, 208 CancelableRequestConsumerBase* consumer,
209 GetFaviconRequest* request) { 209 GetFaviconRequest* request) {
210 AddRequest(request, consumer); 210 AddRequest(request, consumer);
211 FaviconService::Handle handle = request->handle(); 211 FaviconService::Handle handle = request->handle();
212 if (page_url.SchemeIs(chrome::kChromeUIScheme) || 212 if (page_url.SchemeIs(chrome::kChromeUIScheme) ||
213 page_url.SchemeIs(chrome::kExtensionScheme)) { 213 page_url.SchemeIs(chrome::kExtensionScheme)) {
214 // TODO(pkotwicz): Pass in desired size and desired scale factors.
215 ChromeWebUIControllerFactory::GetInstance()->GetFaviconForURL( 214 ChromeWebUIControllerFactory::GetInstance()->GetFaviconForURL(
216 profile, request, page_url); 215 profile, request, page_url, desired_scale_factors);
217 } else { 216 } else {
218 // TODO(pkotwicz): Pass in desired size and desired scale factors. 217 // TODO(pkotwicz): Pass in desired size and desired scale factors.
219 if (history_service_) 218 if (history_service_)
220 history_service_->GetFaviconForURL(request, page_url, icon_types); 219 history_service_->GetFaviconForURL(request, page_url, icon_types);
221 else 220 else
222 ForwardEmptyResultAsync(request); 221 ForwardEmptyResultAsync(request);
223 } 222 }
224 return handle; 223 return handle;
225 } 224 }
226 225
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 bitmap_result.bitmap_data = base::RefCountedBytes::TakeVector( 292 bitmap_result.bitmap_data = base::RefCountedBytes::TakeVector(
294 &resized_bitmap_data); 293 &resized_bitmap_data);
295 callback.Run(handle, bitmap_result); 294 callback.Run(handle, bitmap_result);
296 } 295 }
297 296
298 void FaviconService::ForwardEmptyResultAsync(GetFaviconRequest* request) { 297 void FaviconService::ForwardEmptyResultAsync(GetFaviconRequest* request) {
299 request->ForwardResultAsync(request->handle(), 298 request->ForwardResultAsync(request->handle(),
300 std::vector<history::FaviconBitmapResult>(), 299 std::vector<history::FaviconBitmapResult>(),
301 history::IconURLSizesMap()); 300 history::IconURLSizesMap());
302 } 301 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/downloads/downloads.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698