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

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

Issue 815983002: Topsites become keyedService based. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra inclusion from testing_profile.h Created 5 years, 11 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/profiles/profile_impl.cc ('k') | chrome/browser/search/instant_service_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/instant_service.cc
diff --git a/chrome/browser/search/instant_service.cc b/chrome/browser/search/instant_service.cc
index 31b68d6fd76e44fe86b706559255f50e5f94f57d..08fb3283c7a15b27daad8f1a80140fd908c9fdbe 100644
--- a/chrome/browser/search/instant_service.cc
+++ b/chrome/browser/search/instant_service.cc
@@ -6,6 +6,7 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/history/top_sites.h"
+#include "chrome/browser/history/top_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"
@@ -92,7 +93,8 @@ InstantService::InstantService(Profile* profile)
content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
content::NotificationService::AllSources());
- history::TopSites* top_sites = profile_->GetTopSites();
+ scoped_refptr<history::TopSites> top_sites =
+ TopSitesFactory::GetForProfile(profile_);
if (top_sites)
top_sites->AddObserver(this);
@@ -158,7 +160,8 @@ void InstantService::RemoveObserver(InstantServiceObserver* observer) {
}
void InstantService::DeleteMostVisitedItem(const GURL& url) {
- history::TopSites* top_sites = profile_->GetTopSites();
+ scoped_refptr<history::TopSites> top_sites =
+ TopSitesFactory::GetForProfile(profile_);
if (!top_sites)
return;
@@ -166,7 +169,8 @@ void InstantService::DeleteMostVisitedItem(const GURL& url) {
}
void InstantService::UndoMostVisitedDeletion(const GURL& url) {
- history::TopSites* top_sites = profile_->GetTopSites();
+ scoped_refptr<history::TopSites> top_sites =
+ TopSitesFactory::GetForProfile(profile_);
if (!top_sites)
return;
@@ -174,7 +178,8 @@ void InstantService::UndoMostVisitedDeletion(const GURL& url) {
}
void InstantService::UndoAllMostVisitedDeletions() {
- history::TopSites* top_sites = profile_->GetTopSites();
+ scoped_refptr<history::TopSites> top_sites =
+ TopSitesFactory::GetForProfile(profile_);
if (!top_sites)
return;
@@ -204,7 +209,8 @@ void InstantService::Shutdown() {
instant_io_context_));
}
- history::TopSites* top_sites = profile_->GetTopSites();
+ scoped_refptr<history::TopSites> top_sites =
+ TopSitesFactory::GetForProfile(profile_);
if (top_sites)
top_sites->RemoveObserver(this);
« no previous file with comments | « chrome/browser/profiles/profile_impl.cc ('k') | chrome/browser/search/instant_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698