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

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

Issue 2292003002: Move OnURLsDeleted from NTPSnippetsService to ContentSuggestionsService (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
« no previous file with comments | « no previous file | components/ntp_snippets/content_suggestions_service.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_PROVIDER_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ 6 #define COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 virtual void DismissSuggestion(const std::string& suggestion_id) = 0; 95 virtual void DismissSuggestion(const std::string& suggestion_id) = 0;
96 96
97 // Fetches the image for the suggestion with the given ID and returns it 97 // Fetches the image for the suggestion with the given ID and returns it
98 // through the callback. This fetch may occur locally or from the internet. 98 // through the callback. This fetch may occur locally or from the internet.
99 // If that suggestion doesn't exist, doesn't have an image or if the fetch 99 // If that suggestion doesn't exist, doesn't have an image or if the fetch
100 // fails, the callback gets a null image. The callback will not be called 100 // fails, the callback gets a null image. The callback will not be called
101 // synchronously. 101 // synchronously.
102 virtual void FetchSuggestionImage(const std::string& suggestion_id, 102 virtual void FetchSuggestionImage(const std::string& suggestion_id,
103 const ImageFetchedCallback& callback) = 0; 103 const ImageFetchedCallback& callback) = 0;
104 104
105 // Removes given list of URLs and associated data (depends on a provider).
Marc Treib 2016/08/30 09:42:32 Removes from where? s/a provider/the provider/
vitaliii 2016/09/02 12:38:30 Done.
106 // Providers should immediately clear any history-related data associated with
107 // |deleted_rows| or all data if |all_history| is true. If |expired| is true,
108 // then the deletion is due to expiration and providers may ignore it.
Marc Treib 2016/08/30 09:42:32 Would any provider ever care about expired URLs? I
vitaliii 2016/09/02 12:38:30 Done.
109 virtual void RemoveURLsFromHistory(bool all_history,
110 bool expired,
111 const history::URLRows& deleted_rows) = 0;
vitaliii 2016/08/30 08:57:31 Marc, would you mind checking the interface? I ign
Marc Treib 2016/08/30 09:42:32 Yup, this sounds reasonable.
Marc Treib 2016/08/30 09:42:32 It might be nice not to use history:: types here,
vitaliii 2016/09/02 12:38:30 Done.
112
105 // Removes history from a given time range. The data removed depends on a 113 // Removes history from a given time range. The data removed depends on a
106 // provider. Note that the data outside the time range may be deleted, for 114 // provider. Note that the data outside the time range may be deleted, for
107 // example suggestions, which are based on the time range. Providers should 115 // example suggestions, which are based on the time range. Providers should
108 // immediately clear any specified time range history-related data, such as 116 // immediately clear any specified time range history-related data, such as
109 // (possibly dismissed) suggestions for NTPSnippetsService or in case of 117 // (possibly dismissed) suggestions for NTPSnippetsService or in case of
110 // BookmarkSuggestionsProvider last visit dates. 118 // BookmarkSuggestionsProvider last visit dates.
111 virtual void ClearHistory(base::Time begin, base::Time end) = 0; 119 virtual void ClearHistory(base::Time begin, base::Time end) = 0;
112 120
113 // Clears all caches for the given category, so that the next fetch starts 121 // Clears all caches for the given category, so that the next fetch starts
114 // from scratch. 122 // from scratch.
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 CategoryFactory* category_factory() const { return category_factory_; } 159 CategoryFactory* category_factory() const { return category_factory_; }
152 160
153 private: 161 private:
154 Observer* observer_; 162 Observer* observer_;
155 CategoryFactory* category_factory_; 163 CategoryFactory* category_factory_;
156 }; 164 };
157 165
158 } // namespace ntp_snippets 166 } // namespace ntp_snippets
159 167
160 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ 168 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/content_suggestions_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698