| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 // URL matches the |filter|. | 112 // URL matches the |filter|. |
| 113 virtual void ClearHistory( | 113 virtual void ClearHistory( |
| 114 base::Time begin, | 114 base::Time begin, |
| 115 base::Time end, | 115 base::Time end, |
| 116 const base::Callback<bool(const GURL& url)>& filter) = 0; | 116 const base::Callback<bool(const GURL& url)>& filter) = 0; |
| 117 | 117 |
| 118 // Clears all caches for the given category, so that the next fetch starts | 118 // Clears all caches for the given category, so that the next fetch starts |
| 119 // from scratch. | 119 // from scratch. |
| 120 virtual void ClearCachedSuggestions(Category category) = 0; | 120 virtual void ClearCachedSuggestions(Category category) = 0; |
| 121 | 121 |
| 122 // Called when the sign in state has changed. Should be used instead of |
| 123 // directly registering with the SignInManager so that the |
| 124 // ContentSuggestionService can control the order of the updates between |
| 125 // the providers and the observers. |
| 126 virtual void OnSignInStateChanged() {} |
| 127 |
| 122 // Used only for debugging purposes. Retrieves suggestions for the given | 128 // Used only for debugging purposes. Retrieves suggestions for the given |
| 123 // |category| that have previously been dismissed and are still stored in the | 129 // |category| that have previously been dismissed and are still stored in the |
| 124 // provider. If the provider doesn't store dismissed suggestions for the given | 130 // provider. If the provider doesn't store dismissed suggestions for the given |
| 125 // |category|, it always calls the callback with an empty vector. The callback | 131 // |category|, it always calls the callback with an empty vector. The callback |
| 126 // may be called synchronously. | 132 // may be called synchronously. |
| 127 virtual void GetDismissedSuggestionsForDebugging( | 133 virtual void GetDismissedSuggestionsForDebugging( |
| 128 Category category, | 134 Category category, |
| 129 const DismissedSuggestionsCallback& callback) = 0; | 135 const DismissedSuggestionsCallback& callback) = 0; |
| 130 | 136 |
| 131 // Used only for debugging purposes. Clears the cache of dismissed | 137 // Used only for debugging purposes. Clears the cache of dismissed |
| (...skipping 11 matching lines...) Expand all Loading... |
| 143 CategoryFactory* category_factory() const { return category_factory_; } | 149 CategoryFactory* category_factory() const { return category_factory_; } |
| 144 | 150 |
| 145 private: | 151 private: |
| 146 Observer* observer_; | 152 Observer* observer_; |
| 147 CategoryFactory* category_factory_; | 153 CategoryFactory* category_factory_; |
| 148 }; | 154 }; |
| 149 | 155 |
| 150 } // namespace ntp_snippets | 156 } // namespace ntp_snippets |
| 151 | 157 |
| 152 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ | 158 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_PROVIDER_H_ |
| OLD | NEW |