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

Unified Diff: chrome/browser/ui/views/frame/global_menu_bar_x11.cc

Issue 815983002: Topsites become keyedService based. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix review 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/ui/views/frame/global_menu_bar_x11.cc
diff --git a/chrome/browser/ui/views/frame/global_menu_bar_x11.cc b/chrome/browser/ui/views/frame/global_menu_bar_x11.cc
index a19b2c3aba8f64d1b7c0c390bdb482a92e3ddea5..4e0d5f2548f70654e625099dd384a2585a508f36 100644
--- a/chrome/browser/ui/views/frame/global_menu_bar_x11.cc
+++ b/chrome/browser/ui/views/frame/global_menu_bar_x11.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/browser_process.h"
#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/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
@@ -426,14 +427,14 @@ void GlobalMenuBarX11::InitServer(unsigned long xid) {
base::Unretained(this)));
OnBookmarkBarVisibilityChanged();
- top_sites_ = profile_->GetTopSites();
- if (top_sites_) {
+ top_sites_ = TopSitesFactory::GetForProfile(profile_);
+ if (top_sites_.get()) {
Bernhard Bauer 2015/01/08 10:22:05 Remove .get().
Jitu( very slow this week) 2015/01/12 11:30:08 Done.
GetTopSitesData();
// 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()));
}
ProfileManager* profile_manager = g_browser_process->profile_manager();
@@ -567,7 +568,7 @@ void GlobalMenuBarX11::AddHistoryItemToMenu(HistoryItem* item,
}
void GlobalMenuBarX11::GetTopSitesData() {
- DCHECK(top_sites_);
+ DCHECK(top_sites_.get());
Bernhard Bauer 2015/01/08 10:22:05 Remove the .get().
Jitu( very slow this week) 2015/01/12 11:30:08 Done.
top_sites_->GetMostVisitedURLs(
base::Bind(&GlobalMenuBarX11::OnTopSitesReceived,

Powered by Google App Engine
This is Rietveld 408576698