Chromium Code Reviews| 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..f48225d6adccb040b2232b5136f5d3110131b91f 100644 |
| --- a/components/ntp_snippets/ntp_snippets_service.h |
| +++ b/components/ntp_snippets/ntp_snippets_service.h |
| @@ -75,11 +75,28 @@ 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. |
|
Bernhard Bauer
2016/04/14 16:50:24
Empty line before comment.
jkrcal
2016/04/15 14:11:50
Done.
|
| + 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 { |
|
Bernhard Bauer
2016/04/14 16:50:24
Somewhat unrelated yak-shaving: Now that we have a
Marc Treib
2016/04/15 09:00:30
+1, but IMO this can wait for another CL.
jkrcal
2016/04/15 14:11:50
I agree, I really did not like the asymmetry when
|
| + 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 +124,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); |