| 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> |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 void ClearCachedSuggestions(Category category) override; | 123 void ClearCachedSuggestions(Category category) override; |
| 124 void GetDismissedSuggestionsForDebugging( | 124 void GetDismissedSuggestionsForDebugging( |
| 125 Category category, | 125 Category category, |
| 126 const DismissedSuggestionsCallback& callback) override; | 126 const DismissedSuggestionsCallback& callback) override; |
| 127 void ClearDismissedSuggestionsForDebugging(Category category) override; | 127 void ClearDismissedSuggestionsForDebugging(Category category) override; |
| 128 | 128 |
| 129 // Returns the maximum number of snippets that will be shown at once. | 129 // Returns the maximum number of snippets that will be shown at once. |
| 130 static int GetMaxSnippetCountForTesting(); | 130 static int GetMaxSnippetCountForTesting(); |
| 131 | 131 |
| 132 // Available snippets, only for unit tests. | 132 // Available snippets, only for unit tests. |
| 133 // TODO(treib): Get rid of this. Tests should use a fake observer instead. |
| 133 const NTPSnippet::PtrVector& GetSnippetsForTesting(Category category) const { | 134 const NTPSnippet::PtrVector& GetSnippetsForTesting(Category category) const { |
| 134 return categories_.find(category)->second.snippets; | 135 return categories_.find(category)->second.snippets; |
| 135 } | 136 } |
| 136 | 137 |
| 137 // Available snippets, only for unit tests. | 138 // Available snippets, only for unit tests. |
| 138 const NTPSnippet::PtrVector& GetArchivedSnippetsForTesting( | 139 const NTPSnippet::PtrVector& GetArchivedSnippetsForTesting( |
| 139 Category category) const { | 140 Category category) const { |
| 140 return categories_.find(category)->second.archived; | 141 return categories_.find(category)->second.archived; |
| 141 } | 142 } |
| 142 | 143 |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 | 357 |
| 357 // Request throttler for limiting requests to thumbnail images. | 358 // Request throttler for limiting requests to thumbnail images. |
| 358 RequestThrottler thumbnail_requests_throttler_; | 359 RequestThrottler thumbnail_requests_throttler_; |
| 359 | 360 |
| 360 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); | 361 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); |
| 361 }; | 362 }; |
| 362 | 363 |
| 363 } // namespace ntp_snippets | 364 } // namespace ntp_snippets |
| 364 | 365 |
| 365 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ | 366 #endif // COMPONENTS_NTP_SNIPPETS_REMOTE_NTP_SNIPPETS_SERVICE_H_ |
| OLD | NEW |