OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_REMOTE_NTP_SNIPPETS_SERVICE_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ |
6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ |
7 | 7 |
8 #include <cstddef> | 8 #include <cstddef> |
9 #include <map> | 9 #include <map> |
10 #include <memory> | 10 #include <memory> |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // Enables the service. Do not call directly, use |EnterState| instead. | 264 // Enables the service. Do not call directly, use |EnterState| instead. |
265 void EnterStateReady(); | 265 void EnterStateReady(); |
266 | 266 |
267 // Disables the service. Do not call directly, use |EnterState| instead. | 267 // Disables the service. Do not call directly, use |EnterState| instead. |
268 void EnterStateDisabled(); | 268 void EnterStateDisabled(); |
269 | 269 |
270 // Disables the service permanently because an unrecoverable error occurred. | 270 // Disables the service permanently because an unrecoverable error occurred. |
271 // Do not call directly, use |EnterState| instead. | 271 // Do not call directly, use |EnterState| instead. |
272 void EnterStateError(); | 272 void EnterStateError(); |
273 | 273 |
274 // Converts the cached snippets to article content suggestions and notifies | 274 // Converts the cached snippets in the given |category| to content suggestions |
275 // the observers. | 275 // and notifies the observer. |
276 void NotifyNewSuggestions(); | 276 void NotifyNewSuggestions(Category category); |
277 | 277 |
278 // Updates the internal status for |category| to |category_status_| and | 278 // Updates the internal status for |category| to |category_status_| and |
279 // notifies the content suggestions observer if it changed. | 279 // notifies the content suggestions observer if it changed. |
280 void UpdateCategoryStatus(Category category, CategoryStatus status); | 280 void UpdateCategoryStatus(Category category, CategoryStatus status); |
281 // Calls UpdateCategoryStatus() for all provided categories. | 281 // Calls UpdateCategoryStatus() for all provided categories. |
282 void UpdateAllCategoryStatus(CategoryStatus status); | 282 void UpdateAllCategoryStatus(CategoryStatus status); |
283 | 283 |
284 void RestoreCategoriesFromPrefs(); | 284 void RestoreCategoriesFromPrefs(); |
285 void StoreCategoriesToPrefs(); | 285 void StoreCategoriesToPrefs(); |
286 | 286 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 | 359 |
360 // Request throttler for limiting requests to thumbnail images. | 360 // Request throttler for limiting requests to thumbnail images. |
361 RequestThrottler thumbnail_requests_throttler_; | 361 RequestThrottler thumbnail_requests_throttler_; |
362 | 362 |
363 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); | 363 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); |
364 }; | 364 }; |
365 | 365 |
366 } // namespace ntp_snippets | 366 } // namespace ntp_snippets |
367 | 367 |
368 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ | 368 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ |
OLD | NEW |