Chromium Code Reviews| 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 <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 93 const ContentSuggestion::ID& suggestion_id) = 0; | 93 const ContentSuggestion::ID& suggestion_id) = 0; |
| 94 | 94 |
| 95 // Fetches the image for the suggestion with the given ID and returns it | 95 // Fetches the image for the suggestion with the given ID and returns it |
| 96 // through the callback. This fetch may occur locally or from the internet. | 96 // through the callback. This fetch may occur locally or from the internet. |
| 97 // If that suggestion doesn't exist, doesn't have an image or if the fetch | 97 // If that suggestion doesn't exist, doesn't have an image or if the fetch |
| 98 // fails, the callback gets a null image. The callback will not be called | 98 // fails, the callback gets a null image. The callback will not be called |
| 99 // synchronously. | 99 // synchronously. |
| 100 virtual void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id, | 100 virtual void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id, |
| 101 const ImageFetchedCallback& callback) = 0; | 101 const ImageFetchedCallback& callback) = 0; |
| 102 | 102 |
| 103 // A user-triggered request to fetch more content for the given category. | |
| 104 // Provides only suggestions that have not already been provided. | |
|
Marc Treib
2016/10/18 08:17:45
There's no "given category" - there probably shoul
fhorschig
2016/10/20 13:10:38
Done. It used to notificate an Observer. Now there
| |
| 105 virtual void FetchMore() = 0; | |
| 106 | |
| 103 // Removes history from the specified time range where the URL matches the | 107 // Removes history from the specified time range where the URL matches the |
| 104 // |filter|. The data removed depends on the provider. Note that the | 108 // |filter|. The data removed depends on the provider. Note that the |
| 105 // data outside the time range may be deleted, for example suggestions, which | 109 // data outside the time range may be deleted, for example suggestions, which |
| 106 // are based on history from that time range. Providers should immediately | 110 // are based on history from that time range. Providers should immediately |
| 107 // clear any data related to history from the specified time range where the | 111 // clear any data related to history from the specified time range where the |
| 108 // URL matches the |filter|. | 112 // URL matches the |filter|. |
| 109 virtual void ClearHistory( | 113 virtual void ClearHistory( |
| 110 base::Time begin, | 114 base::Time begin, |
| 111 base::Time end, | 115 base::Time end, |
| 112 const base::Callback<bool(const GURL& url)>& filter) = 0; | 116 const base::Callback<bool(const GURL& url)>& filter) = 0; |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 139 CategoryFactory* category_factory() const { return category_factory_; } | 143 CategoryFactory* category_factory() const { return category_factory_; } |
| 140 | 144 |
| 141 private: | 145 private: |
| 142 Observer* observer_; | 146 Observer* observer_; |
| 143 CategoryFactory* category_factory_; | 147 CategoryFactory* category_factory_; |
| 144 }; | 148 }; |
| 145 | 149 |
| 146 } // namespace ntp_snippets | 150 } // namespace ntp_snippets |
| 147 | 151 |
| 148 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ | 152 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ |
| OLD | NEW |