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

Side by Side Diff: chrome/browser/sync/glue/favicon_cache.cc

Issue 331163003: [Refactor] Change FaviconService API to take in a desired pixel size (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/sync/glue/favicon_cache.h" 5 #include "chrome/browser/sync/glue/favicon_cache.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "chrome/browser/chrome_notification_types.h" 9 #include "chrome/browser/chrome_notification_types.h"
10 #include "chrome/browser/favicon/favicon_service.h" 10 #include "chrome/browser/favicon/favicon_service.h"
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 } 436 }
437 FaviconService* favicon_service = 437 FaviconService* favicon_service =
438 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); 438 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
439 if (!favicon_service) 439 if (!favicon_service)
440 return; 440 return;
441 // TODO(zea): This appears to only fetch one favicon (best match based on 441 // TODO(zea): This appears to only fetch one favicon (best match based on
442 // desired_size_in_dip). Figure out a way to fetch all favicons we support. 442 // desired_size_in_dip). Figure out a way to fetch all favicons we support.
443 // See crbug.com/181068. 443 // See crbug.com/181068.
444 base::CancelableTaskTracker::TaskId id = 444 base::CancelableTaskTracker::TaskId id =
445 favicon_service->GetFaviconForPageURL( 445 favicon_service->GetFaviconForPageURL(
446 FaviconService::FaviconForPageURLParams( 446 page_url,
447 page_url, SupportedFaviconTypes(), kMaxFaviconResolution), 447 SupportedFaviconTypes(),
448 kMaxFaviconResolution,
448 base::Bind(&FaviconCache::OnFaviconDataAvailable, 449 base::Bind(&FaviconCache::OnFaviconDataAvailable,
449 weak_ptr_factory_.GetWeakPtr(), 450 weak_ptr_factory_.GetWeakPtr(),
450 page_url), 451 page_url),
451 &cancelable_task_tracker_); 452 &cancelable_task_tracker_);
452 page_task_map_[page_url] = id; 453 page_task_map_[page_url] = id;
453 } 454 }
454 455
455 void FaviconCache::OnFaviconVisited(const GURL& page_url, 456 void FaviconCache::OnFaviconVisited(const GURL& page_url,
456 const GURL& favicon_url) { 457 const GURL& favicon_url) {
457 DCHECK(page_url.is_valid()); 458 DCHECK(page_url.is_valid());
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
1058 1059
1059 size_t FaviconCache::NumFaviconsForTest() const { 1060 size_t FaviconCache::NumFaviconsForTest() const {
1060 return synced_favicons_.size(); 1061 return synced_favicons_.size();
1061 } 1062 }
1062 1063
1063 size_t FaviconCache::NumTasksForTest() const { 1064 size_t FaviconCache::NumTasksForTest() const {
1064 return page_task_map_.size(); 1065 return page_task_map_.size();
1065 } 1066 }
1066 1067
1067 } // namespace browser_sync 1068 } // namespace browser_sync
OLDNEW
« no previous file with comments | « chrome/browser/notifications/message_center_settings_controller.cc ('k') | chrome/browser/ui/android/navigation_popup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698