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

Unified Diff: chrome/browser/jumplist_win.cc

Issue 815983002: Topsites become keyedService based. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix comments 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
Index: chrome/browser/jumplist_win.cc
diff --git a/chrome/browser/jumplist_win.cc b/chrome/browser/jumplist_win.cc
index 1eb72f594f41574bbd54ba47ee04b41fa57b670f..4dc93b2798fcb014bdf754121e1a55a55392ea6b 100644
--- a/chrome/browser/jumplist_win.cc
+++ b/chrome/browser/jumplist_win.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/history/history_service.h"
#include "chrome/browser/history/top_sites.h"
+#include "chrome/browser/history/top_sites_factory.h"
#include "chrome/browser/metrics/jumplist_metrics_win.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_info_cache.h"
@@ -248,7 +249,8 @@ JumpList::JumpList(Profile* profile)
icon_dir_ = profile_->GetPath().Append(chrome::kJumpListIconDirname);
use_profiles_category_ = HasProfilesJumplistExperiment();
- history::TopSites* top_sites = profile_->GetTopSites();
+ scoped_refptr<history::TopSites> top_sites =
+ TopSitesFactory::GetForProfile(profile_);
if (top_sites) {
// TopSites updates itself after a delay. This is especially noticable when
// your profile is empty. Ask TopSites to update itself when jumplist is
@@ -258,7 +260,7 @@ JumpList::JumpList(Profile* profile)
// Register for notification when TopSites changes so that we can update
// ourself.
registrar_->Add(this, chrome::NOTIFICATION_TOP_SITES_CHANGED,
- content::Source<history::TopSites>(top_sites));
+ content::Source<history::TopSites>(top_sites.get()));
// Register for notification when profile is destroyed to ensure that all
// observers are detatched at that time.
registrar_->Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
@@ -293,7 +295,8 @@ void JumpList::Observe(int type,
switch (type) {
case chrome::NOTIFICATION_TOP_SITES_CHANGED: {
// Most visited urls changed, query again.
- history::TopSites* top_sites = profile_->GetTopSites();
+ scoped_refptr<history::TopSites> top_sites =
+ TopSitesFactory::GetForProfile(profile_);
if (top_sites) {
top_sites->GetMostVisitedURLs(
base::Bind(&JumpList::OnMostVisitedURLsAvailable,

Powered by Google App Engine
This is Rietveld 408576698