| 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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 Category category, | 224 Category category, |
| 225 const DismissedSuggestionsCallback& callback); | 225 const DismissedSuggestionsCallback& callback); |
| 226 | 226 |
| 227 // Only for debugging use through the internals page. Some providers | 227 // Only for debugging use through the internals page. Some providers |
| 228 // internally store a list of dismissed suggestions to prevent them from | 228 // internally store a list of dismissed suggestions to prevent them from |
| 229 // reappearing. This function clears all suggestions of the given |category| | 229 // reappearing. This function clears all suggestions of the given |category| |
| 230 // from such lists, making dismissed suggestions reappear (if the provider | 230 // from such lists, making dismissed suggestions reappear (if the provider |
| 231 // supports it). | 231 // supports it). |
| 232 void ClearDismissedSuggestionsForDebugging(Category category); | 232 void ClearDismissedSuggestionsForDebugging(Category category); |
| 233 | 233 |
| 234 // Enables or disables the remote suggestions service. | 234 // Enables or disables the remote suggestions provider. |
| 235 void SetRemoteSuggestionsServiceEnabled(bool enabled); | 235 void SetRemoteSuggestionsEnabled(bool enabled); |
| 236 | 236 |
| 237 // Returns true if the remote suggestions service is enabled. | 237 // Returns true if the remote suggestions provider is enabled. |
| 238 bool IsRemoteSuggestionsServiceEnabled() const; | 238 bool AreRemoteSuggestionsEnabled() const; |
| 239 | 239 |
| 240 // Returns true if the remote service is managed by an adminstrator's policy. | 240 // Returns true if the remote provider is managed by an adminstrator's policy. |
| 241 bool IsRemoteSuggestionsServiceManaged() const; | 241 bool AreRemoteSuggestionsManaged() const; |
| 242 | 242 |
| 243 // Returns true if the remote service is managed by the guardian/parent of a | 243 // Returns true if the remote provider is managed by the guardian/parent of a |
| 244 // child account. | 244 // child account. |
| 245 bool IsRemoteSuggestionsServiceManagedByCustodian() const; | 245 bool AreRemoteSuggestionsManagedByCustodian() const; |
| 246 | 246 |
| 247 // The reference to the RemoteSuggestionsProvider provider should | 247 // The reference to the RemoteSuggestionsProvider provider should |
| 248 // only be set by the factory and only used for debugging. | 248 // only be set by the factory and only used for debugging. |
| 249 // TODO(jkrcal) The way we deal with the circular dependency feels wrong. | 249 // TODO(jkrcal) The way we deal with the circular dependency feels wrong. |
| 250 // Consider swapping the dependencies: first constructing all providers, then | 250 // Consider swapping the dependencies: first constructing all providers, then |
| 251 // constructing the service (passing the remote provider as arg), finally | 251 // constructing the service (passing the remote provider as arg), finally |
| 252 // registering the service as an observer of all providers? | 252 // registering the service as an observer of all providers? |
| 253 // TODO(jkrcal) Move the getter into the scheduler interface (the setter is | 253 // TODO(jkrcal) Move the getter into the scheduler interface (the setter is |
| 254 // then not needed any more). crbug.com/695447 | 254 // then not needed any more). crbug.com/695447 |
| 255 void set_remote_suggestions_provider( | 255 void set_remote_suggestions_provider( |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 | 408 |
| 409 // Provides order for categories. | 409 // Provides order for categories. |
| 410 std::unique_ptr<CategoryRanker> category_ranker_; | 410 std::unique_ptr<CategoryRanker> category_ranker_; |
| 411 | 411 |
| 412 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsService); | 412 DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsService); |
| 413 }; | 413 }; |
| 414 | 414 |
| 415 } // namespace ntp_snippets | 415 } // namespace ntp_snippets |
| 416 | 416 |
| 417 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ | 417 #endif // COMPONENTS_NTP_SNIPPETS_CONTENT_SUGGESTIONS_SERVICE_H_ |
| OLD | NEW |