Chromium Code Reviews| 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> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 56 EXPLICITLY_DISABLED, | 56 EXPLICITLY_DISABLED, |
| 57 // History sync is not enabled, and the service requires it to be enabled. | 57 // History sync is not enabled, and the service requires it to be enabled. |
| 58 HISTORY_SYNC_DISABLED, | 58 HISTORY_SYNC_DISABLED, |
| 59 // The sync service is not completely initialized, and the status is unknown. | 59 // The sync service is not completely initialized, and the status is unknown. |
| 60 HISTORY_SYNC_STATE_UNKNOWN | 60 HISTORY_SYNC_STATE_UNKNOWN |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 class NTPSnippetsDatabase; | 63 class NTPSnippetsDatabase; |
| 64 class NTPSnippetsServiceObserver; | 64 class NTPSnippetsServiceObserver; |
| 65 | 65 |
| 66 // TODO IMPORTANT NOTE: This service will move to a sub-namespace and become | |
| 67 // a SnippetProvider. To access available snippets from outside, please use the | |
| 68 // "SnippetService". | |
|
Marc Treib
2016/06/13 13:08:17
Same thing here.
Philipp Keck
2016/06/13 14:13:14
Done.
| |
| 69 | |
| 66 // Stores and vends fresh content data for the NTP. | 70 // Stores and vends fresh content data for the NTP. |
| 67 class NTPSnippetsService : public KeyedService, | 71 class NTPSnippetsService : public KeyedService, |
| 68 public sync_driver::SyncServiceObserver { | 72 public sync_driver::SyncServiceObserver { |
| 69 public: | 73 public: |
| 70 using ImageFetchedCallback = | 74 using ImageFetchedCallback = |
| 71 base::Callback<void(const std::string& snippet_id, const gfx::Image&)>; | 75 base::Callback<void(const std::string& snippet_id, const gfx::Image&)>; |
| 72 | 76 |
| 73 // |application_language_code| should be a ISO 639-1 compliant string, e.g. | 77 // |application_language_code| should be a ISO 639-1 compliant string, e.g. |
| 74 // 'en' or 'en-US'. Note that this code should only specify the language, not | 78 // 'en' or 'en-US'. Note that this code should only specify the language, not |
| 75 // the locale, so 'en_US' (English language with US locale) and 'en-GB_US' | 79 // the locale, so 'en_US' (English language with US locale) and 'en-GB_US' |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 313 // or because a requirement (e.g. History Sync) is not fulfilled anymore. | 317 // or because a requirement (e.g. History Sync) is not fulfilled anymore. |
| 314 virtual void NTPSnippetsServiceDisabled() = 0; | 318 virtual void NTPSnippetsServiceDisabled() = 0; |
| 315 | 319 |
| 316 protected: | 320 protected: |
| 317 virtual ~NTPSnippetsServiceObserver() {} | 321 virtual ~NTPSnippetsServiceObserver() {} |
| 318 }; | 322 }; |
| 319 | 323 |
| 320 } // namespace ntp_snippets | 324 } // namespace ntp_snippets |
| 321 | 325 |
| 322 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 326 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
| OLD | NEW |