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

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: Unit tests 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
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 d6ab94c7f476981938ea99aa637bbf7dcdba7623..dabc8e3c5d1f1da237f1d893d51e5ecccd374da5 100644
--- a/components/ntp_snippets/ntp_snippets_service.h
+++ b/components/ntp_snippets/ntp_snippets_service.h
@@ -75,11 +75,26 @@ 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& GetDiscardedSnippets();
Marc Treib 2016/04/13 08:45:52 Should be const (add "const" just before the semic
jkrcal 2016/04/14 15:27:00 Done.
+
+ // 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();
Marc Treib 2016/04/13 08:45:52 Also const please
jkrcal 2016/04/14 15:27:01 Done.
+
// Observer accessors.
void AddObserver(NTPSnippetsServiceObserver* observer);
void RemoveObserver(NTPSnippetsServiceObserver* observer);
@@ -107,8 +122,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);

Powered by Google App Engine
This is Rietveld 408576698