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

Unified Diff: components/ntp_snippets/ntp_snippets_service.h

Issue 1883523002: chrome://snippets-internals page for debugging NTP snippets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implementing last suggestions from Bernhard Created 4 years, 8 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
« no previous file with comments | « chrome/common/url_constants.cc ('k') | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/ntp_snippets_service.h
diff --git a/components/ntp_snippets/ntp_snippets_service.h b/components/ntp_snippets/ntp_snippets_service.h
index 0ba1efb611d99b8eff305813c9f85b89753ee114..39e8dc8c8c052f1bf189278bcf188acf87fda569 100644
--- a/components/ntp_snippets/ntp_snippets_service.h
+++ b/components/ntp_snippets/ntp_snippets_service.h
@@ -75,11 +75,29 @@ class NTPSnippetsService : public KeyedService {
// Fetches snippets from the server and adds them to the current ones.
void FetchSnippets();
+ // Fetches snippets from the server for specified hosts (overriding
+ // suggestions from the suggestion service) and adds them to the current ones.
+ void FetchSnippetsFromHosts(const std::set<std::string>& hosts);
+
+ // Deletes all currently stored snippets.
+ void ClearSnippets();
// Discards the snippet with the given |url|, if it exists. Returns true iff
// a snippet was discarded.
bool DiscardSnippet(const GURL& url);
+ // Returns the lists of snippets previously discarded by the user (that are
+ // not expired yet).
+ const NTPSnippetStorage& discarded_snippets() const {
+ return discarded_snippets_;
+ }
+
+ // Clears the lists of snippets previously discarded by the user.
+ void ClearDiscardedSnippets();
+
+ // Returns the lists of suggestion hosts the snippets are restricted to.
+ std::set<std::string> GetSuggestionsHosts() const;
+
// Observer accessors.
void AddObserver(NTPSnippetsServiceObserver* observer);
void RemoveObserver(NTPSnippetsServiceObserver* observer);
@@ -107,8 +125,6 @@ class NTPSnippetsService : public KeyedService {
scoped_ptr<base::Value> parsed);
void OnJsonError(const std::string& snippets_json, const std::string& error);
- void FetchSnippetsImpl(const std::set<std::string>& hosts);
-
// Expects a top-level dictionary containing a "recos" list, which will be
// passed to LoadFromListValue().
bool LoadFromValue(const base::Value& value);
« no previous file with comments | « chrome/common/url_constants.cc ('k') | components/ntp_snippets/ntp_snippets_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698