| 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/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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 const FaviconService::FaviconResultsCallback& callback) { | 377 const FaviconService::FaviconResultsCallback& callback) { |
| 378 GetFaviconService()->UpdateFaviconMappingAndFetch(page_url, icon_url, | 378 GetFaviconService()->UpdateFaviconMappingAndFetch(page_url, icon_url, |
| 379 icon_type, consumer, callback); | 379 icon_type, consumer, callback); |
| 380 } | 380 } |
| 381 | 381 |
| 382 void FaviconHandler::GetFavicon( | 382 void FaviconHandler::GetFavicon( |
| 383 const GURL& icon_url, | 383 const GURL& icon_url, |
| 384 history::IconType icon_type, | 384 history::IconType icon_type, |
| 385 CancelableRequestConsumerBase* consumer, | 385 CancelableRequestConsumerBase* consumer, |
| 386 const FaviconService::FaviconResultsCallback& callback) { | 386 const FaviconService::FaviconResultsCallback& callback) { |
| 387 GetFaviconService()->GetFavicon(icon_url, icon_type, preferred_icon_size(), | 387 GetFaviconService()->GetFavicon( |
| 388 ui::GetSupportedScaleFactors(), consumer, callback); | 388 FaviconService::FaviconParams(icon_url, icon_type, |
| 389 preferred_icon_size(), consumer), |
| 390 ui::GetSupportedScaleFactors(), callback); |
| 389 } | 391 } |
| 390 | 392 |
| 391 void FaviconHandler::GetFaviconForURL( | 393 void FaviconHandler::GetFaviconForURL( |
| 392 const GURL& page_url, | 394 const GURL& page_url, |
| 393 int icon_types, | 395 int icon_types, |
| 394 CancelableRequestConsumerBase* consumer, | 396 CancelableRequestConsumerBase* consumer, |
| 395 const FaviconService::FaviconResultsCallback& callback) { | 397 const FaviconService::FaviconResultsCallback& callback) { |
| 396 GetFaviconService()->GetFaviconForURL(profile_, page_url, icon_types, | 398 GetFaviconService()->GetFaviconForURL( |
| 397 preferred_icon_size(), ui::GetSupportedScaleFactors(), consumer, | 399 FaviconService::FaviconForURLParams(profile_, page_url, icon_types, |
| 398 callback); | 400 preferred_icon_size(), consumer), |
| 401 ui::GetSupportedScaleFactors(), callback); |
| 399 } | 402 } |
| 400 | 403 |
| 401 void FaviconHandler::SetHistoryFavicon( | 404 void FaviconHandler::SetHistoryFavicon( |
| 402 const GURL& page_url, | 405 const GURL& page_url, |
| 403 const GURL& icon_url, | 406 const GURL& icon_url, |
| 404 const std::vector<unsigned char>& image_data, | 407 const std::vector<unsigned char>& image_data, |
| 405 history::IconType icon_type) { | 408 history::IconType icon_type) { |
| 406 GetFaviconService()->SetFavicon(page_url, icon_url, image_data, icon_type); | 409 GetFaviconService()->SetFavicon(page_url, icon_url, image_data, icon_type); |
| 407 } | 410 } |
| 408 | 411 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 int height = bitmap.height(); | 571 int height = bitmap.height(); |
| 569 if (width > 0 && height > 0) { | 572 if (width > 0 && height > 0) { |
| 570 gfx::CalculateFaviconTargetSize(&width, &height); | 573 gfx::CalculateFaviconTargetSize(&width, &height); |
| 571 return gfx::Image(skia::ImageOperations::Resize( | 574 return gfx::Image(skia::ImageOperations::Resize( |
| 572 bitmap, skia::ImageOperations::RESIZE_LANCZOS3, | 575 bitmap, skia::ImageOperations::RESIZE_LANCZOS3, |
| 573 width, height)); | 576 width, height)); |
| 574 } | 577 } |
| 575 | 578 |
| 576 return image; | 579 return image; |
| 577 } | 580 } |
| OLD | NEW |