| 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> |
| 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/callback_forward.h" |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/macros.h" | 17 #include "base/macros.h" |
| 18 #include "base/time/time.h" |
| 18 #include "components/image_fetcher/image_fetcher_delegate.h" | 19 #include "components/image_fetcher/image_fetcher_delegate.h" |
| 19 #include "components/ntp_snippets/category.h" | 20 #include "components/ntp_snippets/category.h" |
| 20 #include "components/ntp_snippets/category_factory.h" | 21 #include "components/ntp_snippets/category_factory.h" |
| 21 #include "components/ntp_snippets/category_status.h" | 22 #include "components/ntp_snippets/category_status.h" |
| 22 #include "components/ntp_snippets/content_suggestion.h" | 23 #include "components/ntp_snippets/content_suggestion.h" |
| 23 #include "components/ntp_snippets/content_suggestions_provider.h" | 24 #include "components/ntp_snippets/content_suggestions_provider.h" |
| 24 #include "components/ntp_snippets/remote/ntp_snippet.h" | 25 #include "components/ntp_snippets/remote/ntp_snippet.h" |
| 25 #include "components/ntp_snippets/remote/ntp_snippets_fetcher.h" | 26 #include "components/ntp_snippets/remote/ntp_snippets_fetcher.h" |
| 26 #include "components/ntp_snippets/remote/ntp_snippets_scheduler.h" | 27 #include "components/ntp_snippets/remote/ntp_snippets_scheduler.h" |
| 27 #include "components/ntp_snippets/remote/ntp_snippets_status_service.h" | 28 #include "components/ntp_snippets/remote/ntp_snippets_status_service.h" |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 NTPSnippetsScheduler* scheduler_; | 336 NTPSnippetsScheduler* scheduler_; |
| 336 | 337 |
| 337 // The snippets fetcher. | 338 // The snippets fetcher. |
| 338 std::unique_ptr<NTPSnippetsFetcher> snippets_fetcher_; | 339 std::unique_ptr<NTPSnippetsFetcher> snippets_fetcher_; |
| 339 | 340 |
| 340 std::unique_ptr<image_fetcher::ImageFetcher> image_fetcher_; | 341 std::unique_ptr<image_fetcher::ImageFetcher> image_fetcher_; |
| 341 std::unique_ptr<image_fetcher::ImageDecoder> image_decoder_; | 342 std::unique_ptr<image_fetcher::ImageDecoder> image_decoder_; |
| 342 | 343 |
| 343 // The database for persisting snippets. | 344 // The database for persisting snippets. |
| 344 std::unique_ptr<NTPSnippetsDatabase> database_; | 345 std::unique_ptr<NTPSnippetsDatabase> database_; |
| 346 base::TimeTicks database_load_start_; |
| 345 | 347 |
| 346 // The service that provides events and data about the signin and sync state. | 348 // The service that provides events and data about the signin and sync state. |
| 347 std::unique_ptr<NTPSnippetsStatusService> snippets_status_service_; | 349 std::unique_ptr<NTPSnippetsStatusService> snippets_status_service_; |
| 348 | 350 |
| 349 // Set to true if FetchSnippets is called while the service isn't ready. | 351 // Set to true if FetchSnippets is called while the service isn't ready. |
| 350 // The fetch will be executed once the service enters the READY state. | 352 // The fetch will be executed once the service enters the READY state. |
| 351 bool fetch_when_ready_; | 353 bool fetch_when_ready_; |
| 352 | 354 |
| 353 // Set to true if NukeAllSnippets is called while the service isn't ready. | 355 // Set to true if NukeAllSnippets is called while the service isn't ready. |
| 354 // The nuke will be executed once the service finishes initialization or | 356 // The nuke will be executed once the service finishes initialization or |
| 355 // enters the READY state. | 357 // enters the READY state. |
| 356 bool nuke_when_initialized_; | 358 bool nuke_when_initialized_; |
| 357 | 359 |
| 358 // Request throttler for limiting requests to thumbnail images. | 360 // Request throttler for limiting requests to thumbnail images. |
| 359 RequestThrottler thumbnail_requests_throttler_; | 361 RequestThrottler thumbnail_requests_throttler_; |
| 360 | 362 |
| 361 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); | 363 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); |
| 362 }; | 364 }; |
| 363 | 365 |
| 364 } // namespace ntp_snippets | 366 } // namespace ntp_snippets |
| 365 | 367 |
| 366 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ | 368 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ |
| OLD | NEW |