| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 static int GetMaxSnippetCountForTesting(); | 157 static int GetMaxSnippetCountForTesting(); |
| 158 | 158 |
| 159 // Available snippets, only for unit tests. | 159 // Available snippets, only for unit tests. |
| 160 const NTPSnippet::PtrVector& GetSnippetsForTesting() const { | 160 const NTPSnippet::PtrVector& GetSnippetsForTesting() const { |
| 161 return snippets_; | 161 return snippets_; |
| 162 } | 162 } |
| 163 | 163 |
| 164 private: | 164 private: |
| 165 friend class NTPSnippetsServiceTest; | 165 friend class NTPSnippetsServiceTest; |
| 166 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsServiceTest, StatusChanges); | 166 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsServiceTest, StatusChanges); |
| 167 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsServiceTest, |
| 168 NukeAllSnippetsRemovesAllSuggestions); |
| 167 | 169 |
| 168 // Possible state transitions: | 170 // Possible state transitions: |
| 169 // NOT_INITED --------+ | 171 // NOT_INITED --------+ |
| 170 // / \ | | 172 // / \ | |
| 171 // v v | | 173 // v v | |
| 172 // READY <--> DISABLED | | 174 // READY <--> DISABLED | |
| 173 // \ / | | 175 // \ / | |
| 174 // v v | | 176 // v v | |
| 175 // ERROR_OCCURRED <-----+ | 177 // ERROR_OCCURRED <-----+ |
| 176 enum class State { | 178 enum class State { |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 | 348 |
| 347 // Request throttler for limiting requests to thumbnail images. | 349 // Request throttler for limiting requests to thumbnail images. |
| 348 RequestThrottler thumbnail_requests_throttler_; | 350 RequestThrottler thumbnail_requests_throttler_; |
| 349 | 351 |
| 350 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); | 352 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); |
| 351 }; | 353 }; |
| 352 | 354 |
| 353 } // namespace ntp_snippets | 355 } // namespace ntp_snippets |
| 354 | 356 |
| 355 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 357 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
| OLD | NEW |