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

Unified Diff: chrome/browser/autocomplete/zero_suggest_provider.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/autocomplete/zero_suggest_provider.cc
diff --git a/chrome/browser/autocomplete/zero_suggest_provider.cc b/chrome/browser/autocomplete/zero_suggest_provider.cc
index efa39c39f3cf2d5e3ffd0b7adb858364802beb74..932ef492104681b4a71bc22c7b238d3cabc9af4e 100644
--- a/chrome/browser/autocomplete/zero_suggest_provider.cc
+++ b/chrome/browser/autocomplete/zero_suggest_provider.cc
@@ -20,6 +20,7 @@
#include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
#include "chrome/browser/autocomplete/history_url_provider.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_engines/template_url_service_factory.h"
#include "chrome/common/pref_names.h"
@@ -316,8 +317,9 @@ AutocompleteMatch ZeroSuggestProvider::NavigationToMatch(
void ZeroSuggestProvider::Run(const GURL& suggest_url) {
if (OmniboxFieldTrial::InZeroSuggestMostVisitedFieldTrial()) {
most_visited_urls_.clear();
- history::TopSites* ts = profile_->GetTopSites();
- if (ts) {
+ scoped_refptr<history::TopSites> ts =
+ TopSitesFactory::GetForProfile(profile_);
+ if (ts.get()) {
Bernhard Bauer 2015/01/08 10:22:04 Remove this.
Jitu( very slow this week) 2015/01/12 11:30:07 Done.
waiting_for_most_visited_urls_request_ = true;
ts->GetMostVisitedURLs(
base::Bind(&ZeroSuggestProvider::OnMostVisitedUrlsAvailable,

Powered by Google App Engine
This is Rietveld 408576698