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

Unified Diff: chrome/browser/ui/webui/ntp/most_visited_handler.cc

Issue 1092873002: [Icons NTP] Refactor large_icon_source to extract the logic shared between desktop and Android to f… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/large_icon_source.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/ntp/most_visited_handler.cc
diff --git a/chrome/browser/ui/webui/ntp/most_visited_handler.cc b/chrome/browser/ui/webui/ntp/most_visited_handler.cc
index cff19a60e1913015633b2212915a8854eeb6146b..e8e8a3fd889a9d45d8560ff88a4b9d8a4fd793e1 100644
--- a/chrome/browser/ui/webui/ntp/most_visited_handler.cc
+++ b/chrome/browser/ui/webui/ntp/most_visited_handler.cc
@@ -21,7 +21,7 @@
#include "base/threading/thread.h"
#include "base/values.h"
#include "chrome/browser/favicon/fallback_icon_service_factory.h"
-#include "chrome/browser/favicon/favicon_service_factory.h"
+#include "chrome/browser/favicon/large_icon_service_factory.h"
#include "chrome/browser/history/top_sites_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/thumbnails/thumbnail_list_source.h"
@@ -38,7 +38,7 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "components/favicon/core/fallback_icon_service.h"
-#include "components/favicon/core/favicon_service.h"
+#include "components/favicon/core/large_icon_service.h"
#include "components/history/core/browser/page_usage_data.h"
#include "components/history/core/browser/top_sites.h"
#include "components/keyed_service/core/service_access_type.h"
@@ -86,15 +86,12 @@ void MostVisitedHandler::RegisterMessages() {
// Set up our sources for top-sites data.
content::URLDataSource::Add(profile, new ThumbnailListSource(profile));
- favicon::FaviconService* favicon_service =
- FaviconServiceFactory::GetForProfile(profile,
- ServiceAccessType::EXPLICIT_ACCESS);
favicon::FallbackIconService* fallback_icon_service =
FallbackIconServiceFactory::GetForBrowserContext(profile);
+ favicon::LargeIconService* large_icon_service =
+ LargeIconServiceFactory::GetForBrowserContext(profile);
- // Register chrome://large-icon as a data source for large icons.
- content::URLDataSource::Add(profile,
- new LargeIconSource(favicon_service, fallback_icon_service));
+ // Register chrome://fallback-icon as a data source for fallback icons.
content::URLDataSource::Add(profile,
new FallbackIconSource(fallback_icon_service));
@@ -102,6 +99,10 @@ void MostVisitedHandler::RegisterMessages() {
content::URLDataSource::Add(
profile, new FaviconSource(profile, FaviconSource::FAVICON));
+ // Register chrome://large-icon as a data source for large icons.
+ content::URLDataSource::Add(
+ profile, new LargeIconSource(fallback_icon_service, large_icon_service));
+
scoped_refptr<history::TopSites> top_sites =
TopSitesFactory::GetForProfile(profile);
if (top_sites) {
« no previous file with comments | « chrome/browser/ui/webui/large_icon_source.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698