| 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 <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 502 client_->GetFaviconService()->GetFavicon( | 502 client_->GetFaviconService()->GetFavicon( |
| 503 icon_url, icon_type, preferred_icon_size(), callback, tracker); | 503 icon_url, icon_type, preferred_icon_size(), callback, tracker); |
| 504 } | 504 } |
| 505 | 505 |
| 506 void FaviconHandler::GetFaviconForURLFromFaviconService( | 506 void FaviconHandler::GetFaviconForURLFromFaviconService( |
| 507 const GURL& page_url, | 507 const GURL& page_url, |
| 508 int icon_types, | 508 int icon_types, |
| 509 const favicon_base::FaviconResultsCallback& callback, | 509 const favicon_base::FaviconResultsCallback& callback, |
| 510 base::CancelableTaskTracker* tracker) { | 510 base::CancelableTaskTracker* tracker) { |
| 511 client_->GetFaviconService()->GetFaviconForPageURL( | 511 client_->GetFaviconService()->GetFaviconForPageURL( |
| 512 FaviconService::FaviconForPageURLParams( | 512 page_url, |
| 513 page_url, icon_types, preferred_icon_size()), | 513 icon_types, |
| 514 preferred_icon_size(), |
| 514 callback, | 515 callback, |
| 515 tracker); | 516 tracker); |
| 516 } | 517 } |
| 517 | 518 |
| 518 void FaviconHandler::SetHistoryFavicons(const GURL& page_url, | 519 void FaviconHandler::SetHistoryFavicons(const GURL& page_url, |
| 519 const GURL& icon_url, | 520 const GURL& icon_url, |
| 520 favicon_base::IconType icon_type, | 521 favicon_base::IconType icon_type, |
| 521 const gfx::Image& image) { | 522 const gfx::Image& image) { |
| 522 client_->GetFaviconService()->SetFavicons( | 523 client_->GetFaviconService()->SetFavicons( |
| 523 page_url, icon_url, icon_type, image); | 524 page_url, icon_url, icon_type, image); |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 680 } else { | 681 } else { |
| 681 gfx::Size largest = i->icon_sizes[index]; | 682 gfx::Size largest = i->icon_sizes[index]; |
| 682 i->icon_sizes.clear(); | 683 i->icon_sizes.clear(); |
| 683 i->icon_sizes.push_back(largest); | 684 i->icon_sizes.push_back(largest); |
| 684 ++i; | 685 ++i; |
| 685 } | 686 } |
| 686 } | 687 } |
| 687 std::stable_sort(image_urls_.begin(), image_urls_.end(), | 688 std::stable_sort(image_urls_.begin(), image_urls_.end(), |
| 688 CompareIconSize); | 689 CompareIconSize); |
| 689 } | 690 } |
| OLD | NEW |