OLD | NEW |
---|---|
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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 | 97 |
98 // Fetches more suggestions for the given category. The new suggestions | 98 // Fetches more suggestions for the given category. The new suggestions |
99 // will not include any suggestion of the |known_suggestion_ids| sets. | 99 // will not include any suggestion of the |known_suggestion_ids| sets. |
100 // The given |callback| is called with these suggestions, along with all | 100 // The given |callback| is called with these suggestions, along with all |
101 // existing suggestions. It has to be invoked exactly once as the front-end | 101 // existing suggestions. It has to be invoked exactly once as the front-end |
102 // might wait for its completion. | 102 // might wait for its completion. |
103 virtual void Fetch(const Category& category, | 103 virtual void Fetch(const Category& category, |
104 const std::set<std::string>& known_suggestion_ids, | 104 const std::set<std::string>& known_suggestion_ids, |
105 const FetchDoneCallback& callback) = 0; | 105 const FetchDoneCallback& callback) = 0; |
106 | 106 |
107 // Reloads suggestions from all categories. Makes sense to call only after | |
tschumann
2016/12/15 19:27:00
Can we find a better name for this method? To me i
jkrcal
2016/12/19 09:40:24
Removed the comment.
As regards naming, this is
| |
108 // some suggestions have been dismissed. The provider may fill in the vacant | |
109 // space by new suggestions that haven't been included previously due to space | |
110 // limits. If this happens, the observer must be notified via | |
111 // OnNewSuggestions(); | |
112 virtual void ReloadSuggestions() {} | |
tschumann
2016/12/15 19:27:00
hm... we should make this pure virtual -- add a TO
jkrcal
2016/12/19 09:40:24
Done.
| |
113 | |
107 // Removes history from the specified time range where the URL matches the | 114 // Removes history from the specified time range where the URL matches the |
108 // |filter|. The data removed depends on the provider. Note that the | 115 // |filter|. The data removed depends on the provider. Note that the |
109 // data outside the time range may be deleted, for example suggestions, which | 116 // data outside the time range may be deleted, for example suggestions, which |
110 // are based on history from that time range. Providers should immediately | 117 // are based on history from that time range. Providers should immediately |
111 // clear any data related to history from the specified time range where the | 118 // clear any data related to history from the specified time range where the |
112 // URL matches the |filter|. | 119 // URL matches the |filter|. |
113 virtual void ClearHistory( | 120 virtual void ClearHistory( |
114 base::Time begin, | 121 base::Time begin, |
115 base::Time end, | 122 base::Time end, |
116 const base::Callback<bool(const GURL& url)>& filter) = 0; | 123 const base::Callback<bool(const GURL& url)>& filter) = 0; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 CategoryFactory* category_factory() const { return category_factory_; } | 156 CategoryFactory* category_factory() const { return category_factory_; } |
150 | 157 |
151 private: | 158 private: |
152 Observer* observer_; | 159 Observer* observer_; |
153 CategoryFactory* category_factory_; | 160 CategoryFactory* category_factory_; |
154 }; | 161 }; |
155 | 162 |
156 } // namespace ntp_snippets | 163 } // namespace ntp_snippets |
157 | 164 |
158 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ | 165 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ |
OLD | NEW |