| 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_NTP_SNIPPETS_SERVICE_H_ | 5 #ifndef COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
| 6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 6 #define COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <set> | 11 #include <set> |
| 12 #include <string> | 12 #include <string> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/callback_forward.h" |
| 15 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 16 #include "base/macros.h" | 17 #include "base/macros.h" |
| 17 #include "base/observer_list.h" | 18 #include "base/observer_list.h" |
| 18 #include "base/scoped_observer.h" | 19 #include "base/scoped_observer.h" |
| 19 #include "base/timer/timer.h" | 20 #include "base/timer/timer.h" |
| 20 #include "components/image_fetcher/image_fetcher_delegate.h" | 21 #include "components/image_fetcher/image_fetcher_delegate.h" |
| 21 #include "components/keyed_service/core/keyed_service.h" | 22 #include "components/keyed_service/core/keyed_service.h" |
| 22 #include "components/ntp_snippets/ntp_snippet.h" | 23 #include "components/ntp_snippets/ntp_snippet.h" |
| 23 #include "components/ntp_snippets/ntp_snippets_fetcher.h" | 24 #include "components/ntp_snippets/ntp_snippets_fetcher.h" |
| 24 #include "components/ntp_snippets/ntp_snippets_scheduler.h" | 25 #include "components/ntp_snippets/ntp_snippets_scheduler.h" |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 // The fetch will be executed after the database load finishes. | 323 // The fetch will be executed after the database load finishes. |
| 323 bool fetch_after_load_; | 324 bool fetch_after_load_; |
| 324 | 325 |
| 325 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); | 326 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); |
| 326 }; | 327 }; |
| 327 | 328 |
| 328 class NTPSnippetsServiceObserver { | 329 class NTPSnippetsServiceObserver { |
| 329 public: | 330 public: |
| 330 // Sent every time the service loads a new set of data. | 331 // Sent every time the service loads a new set of data. |
| 331 virtual void NTPSnippetsServiceLoaded() = 0; | 332 virtual void NTPSnippetsServiceLoaded() = 0; |
| 333 |
| 332 // Sent when the service is shutting down. | 334 // Sent when the service is shutting down. |
| 333 virtual void NTPSnippetsServiceShutdown() = 0; | 335 virtual void NTPSnippetsServiceShutdown() = 0; |
| 336 |
| 334 // Sent when the service has been disabled. Can be from explicit user action | 337 // Sent when the service has been disabled. Can be from explicit user action |
| 335 // or because a requirement (e.g. History Sync) is not fulfilled anymore. | 338 // or because a requirement (e.g. History Sync) is not fulfilled anymore. |
| 336 virtual void NTPSnippetsServiceDisabled() = 0; | 339 virtual void NTPSnippetsServiceDisabled() = 0; |
| 337 | 340 |
| 338 protected: | 341 protected: |
| 339 virtual ~NTPSnippetsServiceObserver() {} | 342 virtual ~NTPSnippetsServiceObserver() {} |
| 340 }; | 343 }; |
| 341 | 344 |
| 342 } // namespace ntp_snippets | 345 } // namespace ntp_snippets |
| 343 | 346 |
| 344 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 347 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
| OLD | NEW |