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

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

Issue 1260113002: Adds an experiment that enabled SuggestionsService suggestions (MostLikely) on LocalNTP (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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/search/instant_service.h
diff --git a/chrome/browser/search/instant_service.h b/chrome/browser/search/instant_service.h
index 44470e203e6a7808df0ca8fd4cde85aa34143648..8892528906e2d0e1781527fefc5449717ece3ccb 100644
--- a/chrome/browser/search/instant_service.h
+++ b/chrome/browser/search/instant_service.h
@@ -15,6 +15,8 @@
#include "components/history/core/browser/top_sites_observer.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/search_engines/template_url_service_observer.h"
+#include "components/suggestions/proto/suggestions.pb.h"
+#include "components/suggestions/suggestions_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "url/gurl.h"
@@ -128,6 +130,9 @@ class InstantService : public KeyedService,
// Called when a renderer process is terminated.
void OnRendererProcessTerminated(int process_id);
+ // Called when SuggestionsService has a new suggestions profile available.
+ void OnSuggestionsAvailable(const suggestions::SuggestionsProfile& profile);
+
// Called when we get new most visited items from TopSites, registered as an
// async callback. Parses them and sends them to the renderer via
// SendMostVisitedItems.
@@ -152,9 +157,12 @@ class InstantService : public KeyedService,
// The process ids associated with Instant processes.
std::set<int> process_ids_;
- // InstantMostVisitedItems sent to the Instant Pages.
+ // InstantMostVisitedItems from TopSites.
std::vector<InstantMostVisitedItem> most_visited_items_;
+ // InstantMostVisitedItems from SuggestionService.
+ std::vector<InstantMostVisitedItem> suggestions_items_;
+
// Theme-related data for NTP overlay to adopt themes.
scoped_ptr<ThemeBackgroundInfo> theme_info_;
@@ -176,6 +184,9 @@ class InstantService : public KeyedService,
scoped_ptr<TemplateURLData> previous_default_search_provider_;
GURL previous_google_base_url_;
+ // Suggestions Service to fetch server suggestions.
+ suggestions::SuggestionsService* suggestions_service_;
+
// Used for Top Sites async retrieval.
base::WeakPtrFactory<InstantService> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698