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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 std::set<std::string> GetSuggestionsHosts() const; | 154 std::set<std::string> GetSuggestionsHosts() const; |
155 | 155 |
156 // Returns the maximum number of snippets that will be shown at once. | 156 // Returns the maximum number of snippets that will be shown at once. |
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 // Dismissed snippets, only for unit tests. |
| 165 const NTPSnippet::PtrVector& GetDismissedSnippetsForTesting() const { |
| 166 return dismissed_snippets_; |
| 167 } |
| 168 |
164 private: | 169 private: |
165 friend class NTPSnippetsServiceTest; | 170 friend class NTPSnippetsServiceTest; |
166 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsServiceTest, StatusChanges); | 171 FRIEND_TEST_ALL_PREFIXES(NTPSnippetsServiceTest, StatusChanges); |
167 | 172 |
168 // Possible state transitions: | 173 // Possible state transitions: |
169 // NOT_INITED --------+ | 174 // NOT_INITED --------+ |
170 // / \ | | 175 // / \ | |
171 // v v | | 176 // v v | |
172 // READY <--> DISABLED | | 177 // READY <--> DISABLED | |
173 // \ / | | 178 // \ / | |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 | 351 |
347 // Request throttler for limiting requests to thumbnail images. | 352 // Request throttler for limiting requests to thumbnail images. |
348 RequestThrottler thumbnail_requests_throttler_; | 353 RequestThrottler thumbnail_requests_throttler_; |
349 | 354 |
350 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); | 355 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); |
351 }; | 356 }; |
352 | 357 |
353 } // namespace ntp_snippets | 358 } // namespace ntp_snippets |
354 | 359 |
355 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 360 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
OLD | NEW |