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

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

Issue 56143002: Make FaviconService() use Porfile as parameter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unit test but break the DEPS Created 7 years, 1 month 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
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 450 matching lines...) Expand 10 before | Expand all | Expand 10 after
461 return; 461 return;
462 } 462 }
463 FaviconService* favicon_service = 463 FaviconService* favicon_service =
464 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS); 464 FaviconServiceFactory::GetForProfile(profile_, Profile::EXPLICIT_ACCESS);
465 if (!favicon_service) 465 if (!favicon_service)
466 return; 466 return;
467 // TODO(zea): This appears to only fetch one favicon (best match based on 467 // TODO(zea): This appears to only fetch one favicon (best match based on
468 // desired_size_in_dip). Figure out a way to fetch all favicons we support. 468 // desired_size_in_dip). Figure out a way to fetch all favicons we support.
469 // See crbug.com/181068. 469 // See crbug.com/181068.
470 CancelableTaskTracker::TaskId id = favicon_service->GetFaviconForURL( 470 CancelableTaskTracker::TaskId id = favicon_service->GetFaviconForURL(
471 FaviconService::FaviconForURLParams( 471 FaviconService::FaviconForURLParams(page_url, SupportedFaviconTypes(),
472 profile_, page_url, SupportedFaviconTypes(), kMaxFaviconResolution), 472 kMaxFaviconResolution),
473 base::Bind(&FaviconCache::OnFaviconDataAvailable, 473 base::Bind(&FaviconCache::OnFaviconDataAvailable,
474 weak_ptr_factory_.GetWeakPtr(), page_url), 474 weak_ptr_factory_.GetWeakPtr(), page_url),
475 &cancelable_task_tracker_); 475 &cancelable_task_tracker_);
476 page_task_map_[page_url] = id; 476 page_task_map_[page_url] = id;
477 } 477 }
478 478
479 void FaviconCache::OnFaviconVisited(const GURL& page_url, 479 void FaviconCache::OnFaviconVisited(const GURL& page_url,
480 const GURL& favicon_url) { 480 const GURL& favicon_url) {
481 DCHECK(page_url.is_valid()); 481 DCHECK(page_url.is_valid());
482 if (!favicon_url.is_valid() || 482 if (!favicon_url.is_valid() ||
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
1034 1034
1035 size_t FaviconCache::NumFaviconsForTest() const { 1035 size_t FaviconCache::NumFaviconsForTest() const {
1036 return synced_favicons_.size(); 1036 return synced_favicons_.size();
1037 } 1037 }
1038 1038
1039 size_t FaviconCache::NumTasksForTest() const { 1039 size_t FaviconCache::NumTasksForTest() const {
1040 return page_task_map_.size(); 1040 return page_task_map_.size();
1041 } 1041 }
1042 1042
1043 } // namespace browser_sync 1043 } // 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