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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 // Observer accessors. | 154 // Observer accessors. |
155 void AddObserver(NTPSnippetsServiceObserver* observer); | 155 void AddObserver(NTPSnippetsServiceObserver* observer); |
156 void RemoveObserver(NTPSnippetsServiceObserver* observer); | 156 void RemoveObserver(NTPSnippetsServiceObserver* observer); |
157 | 157 |
158 // Returns the maximum number of snippets that will be shown at once. | 158 // Returns the maximum number of snippets that will be shown at once. |
159 static int GetMaxSnippetCountForTesting(); | 159 static int GetMaxSnippetCountForTesting(); |
160 | 160 |
161 private: | 161 private: |
162 friend class NTPSnippetsServiceTest; | 162 friend class NTPSnippetsServiceTest; |
163 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsServiceTest, HistorySyncStateChanges); | 163 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsServiceTest, StatusChanges); |
164 | 164 |
165 // TODO(pke): As soon as the DisabledReason is replaced with the new status, | 165 // TODO(pke): As soon as the DisabledReason is replaced with the new status, |
166 // also remove the old State enum and replace it with | 166 // also remove the old State enum and replace it with |
167 // ContentSuggestionsCategoryStatus and a similar status diagram. | 167 // ContentSuggestionsCategoryStatus and a similar status diagram. |
168 // Possible state transitions: | 168 // Possible state transitions: |
169 // +------- NOT_INITED ------+ | 169 // +------- NOT_INITED ------+ |
170 // | / \ | | 170 // | / \ | |
171 // | READY <--> DISABLED <-+ | 171 // | READY <--> DISABLED <-+ |
172 // | \ / | 172 // | \ / |
173 // +-----> SHUT_DOWN | 173 // +-----> SHUT_DOWN |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 // If the service might be enabled, DisabledReason::NONE will be provided. | 341 // If the service might be enabled, DisabledReason::NONE will be provided. |
342 virtual void NTPSnippetsServiceDisabledReasonChanged(DisabledReason) = 0; | 342 virtual void NTPSnippetsServiceDisabledReasonChanged(DisabledReason) = 0; |
343 | 343 |
344 protected: | 344 protected: |
345 virtual ~NTPSnippetsServiceObserver() {} | 345 virtual ~NTPSnippetsServiceObserver() {} |
346 }; | 346 }; |
347 | 347 |
348 } // namespace ntp_snippets | 348 } // namespace ntp_snippets |
349 | 349 |
350 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 350 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
OLD | NEW |