| Index: chrome/browser/search/instant_service.cc
|
| diff --git a/chrome/browser/search/instant_service.cc b/chrome/browser/search/instant_service.cc
|
| index 1144e405f7885dd2572749e7fd40575caf337fa9..ba7c41971727f0eec293ddd1c9702ad052f4dfbc 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,11 +93,11 @@ 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) {
|
| - registrar_.Add(this,
|
| - chrome::NOTIFICATION_TOP_SITES_CHANGED,
|
| - content::Source<history::TopSites>(top_sites));
|
| + registrar_.Add(this, chrome::NOTIFICATION_TOP_SITES_CHANGED,
|
| + content::Source<history::TopSites>(top_sites.get()));
|
| }
|
|
|
| if (profile_ && profile_->GetResourceContext()) {
|
| @@ -161,7 +162,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;
|
|
|
| @@ -169,7 +171,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;
|
|
|
| @@ -177,7 +180,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;
|
|
|
| @@ -222,11 +226,13 @@ void InstantService::Observe(int type,
|
| content::Source<content::RenderProcessHost>(source)->GetID());
|
| break;
|
| case chrome::NOTIFICATION_TOP_SITES_CHANGED: {
|
| - history::TopSites* top_sites = profile_->GetTopSites();
|
| + scoped_refptr<history::TopSites> top_sites =
|
| + TopSitesFactory::GetForProfile(profile_);
|
| if (top_sites) {
|
| top_sites->GetMostVisitedURLs(
|
| base::Bind(&InstantService::OnMostVisitedItemsReceived,
|
| - weak_ptr_factory_.GetWeakPtr()), false);
|
| + weak_ptr_factory_.GetWeakPtr()),
|
| + false);
|
| }
|
| break;
|
| }
|
|
|