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_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 <set> | 10 #include <set> |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 // from such lists, making dismissed suggestions reappear (if the provider | 205 // from such lists, making dismissed suggestions reappear (if the provider |
206 // supports it). | 206 // supports it). |
207 void ClearDismissedSuggestionsForDebugging(Category category); | 207 void ClearDismissedSuggestionsForDebugging(Category category); |
208 | 208 |
209 // The reference to the RemoteSuggestionsProvider provider should | 209 // The reference to the RemoteSuggestionsProvider provider should |
210 // only be set by the factory and only used for debugging. | 210 // only be set by the factory and only used for debugging. |
211 // TODO(jkrcal) The way we deal with the circular dependency feels wrong. | 211 // TODO(jkrcal) The way we deal with the circular dependency feels wrong. |
212 // Consider swapping the dependencies: first constructing all providers, then | 212 // Consider swapping the dependencies: first constructing all providers, then |
213 // constructing the service (passing the remote provider as arg), finally | 213 // constructing the service (passing the remote provider as arg), finally |
214 // registering the service as an observer of all providers? | 214 // registering the service as an observer of all providers? |
| 215 // TODO(jkrcal) Move the getter into the scheduler interface (the setter is |
| 216 // then not needed any more). crbug.com/695447 |
215 void set_remote_suggestions_provider( | 217 void set_remote_suggestions_provider( |
216 RemoteSuggestionsProvider* remote_suggestions_provider) { | 218 RemoteSuggestionsProvider* remote_suggestions_provider) { |
217 remote_suggestions_provider_ = remote_suggestions_provider; | 219 remote_suggestions_provider_ = remote_suggestions_provider; |
218 } | 220 } |
219 RemoteSuggestionsProvider* remote_suggestions_provider_for_debugging() { | 221 RemoteSuggestionsProvider* remote_suggestions_provider_for_debugging() { |
220 return remote_suggestions_provider_; | 222 return remote_suggestions_provider_; |
221 } | 223 } |
222 | 224 |
223 // The reference to RemoteSuggestionsScheduler should only be set by the | 225 // The reference to RemoteSuggestionsScheduler should only be set by the |
224 // factory. The interface is suited for informing about external events that | 226 // factory. The interface is suited for informing about external events that |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 | 351 |
350 // Provides order for categories. | 352 // Provides order for categories. |
351 std::unique_ptr<CategoryRanker> category_ranker_; | 353 std::unique_ptr<CategoryRanker> category_ranker_; |
352 | 354 |
353 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsService); | 355 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsService); |
354 }; | 356 }; |
355 | 357 |
356 } // namespace ntp_snippets | 358 } // namespace ntp_snippets |
357 | 359 |
358 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ | 360 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ |
OLD | NEW |