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

Unified Diff: chrome/browser/search/instant_service.cc

Issue 2572533002: Add ChromeMostVisitedSitesFactory (Closed)
Patch Set: Use factory for webui Created 4 years 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
Index: chrome/browser/search/instant_service.cc
diff --git a/chrome/browser/search/instant_service.cc b/chrome/browser/search/instant_service.cc
index c897a96cf9580815969ed9f8b9e5b7ace20c42b9..3d5863dbb45a41b4987ce9f464745cb2a868e13c 100644
--- a/chrome/browser/search/instant_service.cc
+++ b/chrome/browser/search/instant_service.cc
@@ -14,6 +14,7 @@
#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/ntp_tiles/chrome_most_visited_sites_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search/instant_io_context.h"
#include "chrome/browser/search/instant_service_observer.h"
@@ -100,20 +101,8 @@ InstantService::InstantService(Profile* profile)
content::NotificationService::AllSources());
if (base::FeatureList::IsEnabled(kNtpTilesFeature)) {
- most_visited_sites_ = base::MakeUnique<ntp_tiles::MostVisitedSites>(
- profile_->GetPrefs(), TopSitesFactory::GetForProfile(profile_),
- suggestions::SuggestionsServiceFactory::GetForProfile(profile_),
- /*popular_sites=*/nullptr,
- base::MakeUnique<ntp_tiles::IconCacher>(
- FaviconServiceFactory::GetForProfile(
- profile, ServiceAccessType::IMPLICIT_ACCESS),
- base::MakeUnique<image_fetcher::ImageFetcherImpl>(
- base::MakeUnique<suggestions::ImageDecoderImpl>(),
- profile->GetRequestContext())),
- /*supervisor=*/nullptr);
- // TODO(treib): Add supervisor.
- // TODO(sfiera): Share this with Android in a factory.
-
+ most_visited_sites_ =
+ ChromeMostVisitedSitesFactory::NewForProfile(profile_);
most_visited_sites_->SetMostVisitedURLsObserver(this, 8);
} else {
top_sites_ = TopSitesFactory::GetForProfile(profile_);
« no previous file with comments | « chrome/browser/ntp_tiles/chrome_popular_sites_factory.cc ('k') | chrome/browser/ui/webui/ntp_tiles_internals_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698