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

Side by Side Diff: components/ntp_snippets/content_suggestions_service.h

Issue 2284393002: Add ClearHistory() to ContentSuggestionsService and its providers (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_
6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ 6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 113
114 // Observer accessors. 114 // Observer accessors.
115 void AddObserver(Observer* observer); 115 void AddObserver(Observer* observer);
116 void RemoveObserver(Observer* observer); 116 void RemoveObserver(Observer* observer);
117 117
118 // Registers a new ContentSuggestionsProvider. It must be ensured that at most 118 // Registers a new ContentSuggestionsProvider. It must be ensured that at most
119 // one provider is registered for every category and that this method is 119 // one provider is registered for every category and that this method is
120 // called only once per provider. 120 // called only once per provider.
121 void RegisterProvider(std::unique_ptr<ContentSuggestionsProvider> provider); 121 void RegisterProvider(std::unique_ptr<ContentSuggestionsProvider> provider);
122 122
123 // Removes history from all providers, for example dismissed suggestions.
124 void ClearHistory();
125
123 // Removes all suggestions from all caches or internal stores in all 126 // Removes all suggestions from all caches or internal stores in all
124 // providers. See |ClearCachedSuggestions|. 127 // providers. See |ClearCachedSuggestions|.
125 void ClearAllCachedSuggestions(); 128 void ClearAllCachedSuggestions();
126 129
127 // Removes all suggestions of the given |category| from all caches or internal 130 // Removes all suggestions of the given |category| from all caches or internal
128 // stores in the service and the corresponding provider. It does, however, not 131 // stores in the service and the corresponding provider. It does, however, not
129 // remove any suggestions from the provider's sources, so if its configuration 132 // remove any suggestions from the provider's sources, so if its configuration
130 // hasn't changed, it might return the same results when it fetches the next 133 // hasn't changed, it might return the same results when it fetches the next
131 // time. In particular, calling this method will not mark any suggestions as 134 // time. In particular, calling this method will not mark any suggestions as
132 // dismissed. 135 // dismissed.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 // background fetching and debugging calls to it. If the NTPSnippetsService is 232 // background fetching and debugging calls to it. If the NTPSnippetsService is
230 // loaded, it is also present in |providers_|, otherwise this is a nullptr. 233 // loaded, it is also present in |providers_|, otherwise this is a nullptr.
231 NTPSnippetsService* ntp_snippets_service_; 234 NTPSnippetsService* ntp_snippets_service_;
232 235
233 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsService); 236 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsService);
234 }; 237 };
235 238
236 } // namespace ntp_snippets 239 } // namespace ntp_snippets
237 240
238 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ 241 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698