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

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

Issue 10918065: Introduce structures to reduce the number of arguments in the FaviconService methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: mac build fix. 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
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_handler.h" 5 #include "chrome/browser/favicon/favicon_handler.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 const FaviconService::FaviconResultsCallback& callback) { 372 const FaviconService::FaviconResultsCallback& callback) {
373 GetFaviconService()->UpdateFaviconMappingAndFetch(page_url, icon_url, 373 GetFaviconService()->UpdateFaviconMappingAndFetch(page_url, icon_url,
374 icon_type, consumer, callback); 374 icon_type, consumer, callback);
375 } 375 }
376 376
377 void FaviconHandler::GetFavicon( 377 void FaviconHandler::GetFavicon(
378 const GURL& icon_url, 378 const GURL& icon_url,
379 history::IconType icon_type, 379 history::IconType icon_type,
380 CancelableRequestConsumerBase* consumer, 380 CancelableRequestConsumerBase* consumer,
381 const FaviconService::FaviconResultsCallback& callback) { 381 const FaviconService::FaviconResultsCallback& callback) {
382 GetFaviconService()->GetFavicon(icon_url, icon_type, preferred_icon_size(), 382 GetFaviconService()->GetFavicon(
383 ui::GetSupportedScaleFactors(), consumer, callback); 383 FaviconService::FaviconParams(icon_url, icon_type,
384 preferred_icon_size(), consumer),
385 ui::GetSupportedScaleFactors(), callback);
384 } 386 }
385 387
386 void FaviconHandler::GetFaviconForURL( 388 void FaviconHandler::GetFaviconForURL(
387 const GURL& page_url, 389 const GURL& page_url,
388 int icon_types, 390 int icon_types,
389 CancelableRequestConsumerBase* consumer, 391 CancelableRequestConsumerBase* consumer,
390 const FaviconService::FaviconResultsCallback& callback) { 392 const FaviconService::FaviconResultsCallback& callback) {
391 GetFaviconService()->GetFaviconForURL(profile_, page_url, icon_types, 393 GetFaviconService()->GetFaviconForURL(
392 preferred_icon_size(), ui::GetSupportedScaleFactors(), consumer, 394 FaviconService::FaviconForURLParams(profile_, page_url, icon_types,
393 callback); 395 preferred_icon_size(), consumer),
396 ui::GetSupportedScaleFactors(), callback);
394 } 397 }
395 398
396 void FaviconHandler::SetHistoryFavicon( 399 void FaviconHandler::SetHistoryFavicon(
397 const GURL& page_url, 400 const GURL& page_url,
398 const GURL& icon_url, 401 const GURL& icon_url,
399 const std::vector<unsigned char>& image_data, 402 const std::vector<unsigned char>& image_data,
400 history::IconType icon_type) { 403 history::IconType icon_type) {
401 GetFaviconService()->SetFavicon(page_url, icon_url, image_data, icon_type); 404 GetFaviconService()->SetFavicon(page_url, icon_url, image_data, icon_type);
402 } 405 }
403 406
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 int height = bitmap.height(); 566 int height = bitmap.height();
564 if (width > 0 && height > 0) { 567 if (width > 0 && height > 0) {
565 gfx::CalculateFaviconTargetSize(&width, &height); 568 gfx::CalculateFaviconTargetSize(&width, &height);
566 return gfx::Image(skia::ImageOperations::Resize( 569 return gfx::Image(skia::ImageOperations::Resize(
567 bitmap, skia::ImageOperations::RESIZE_LANCZOS3, 570 bitmap, skia::ImageOperations::RESIZE_LANCZOS3,
568 width, height)); 571 width, height));
569 } 572 }
570 573
571 return image; 574 return image;
572 } 575 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698