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 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 void UpdateAllCategoryStatus(CategoryStatus status); | 283 void UpdateAllCategoryStatus(CategoryStatus status); |
284 | 284 |
285 State state_; | 285 State state_; |
286 | 286 |
287 PrefService* pref_service_; | 287 PrefService* pref_service_; |
288 | 288 |
289 suggestions::SuggestionsService* suggestions_service_; | 289 suggestions::SuggestionsService* suggestions_service_; |
290 | 290 |
291 const Category articles_category_; | 291 const Category articles_category_; |
292 | 292 |
| 293 // TODO(sfiera): Reduce duplication of CategoryContent with CategoryInfo. |
293 struct CategoryContent { | 294 struct CategoryContent { |
294 CategoryStatus status = CategoryStatus::INITIALIZING; | 295 CategoryStatus status = CategoryStatus::INITIALIZING; |
295 | 296 |
| 297 // The title of the section, localized to the running UI language. |
| 298 base::string16 localized_title; |
| 299 |
296 // True iff the server returned results in this category in the last fetch. | 300 // True iff the server returned results in this category in the last fetch. |
297 // We never remove categories that the server still provides, but if the | 301 // We never remove categories that the server still provides, but if the |
298 // server stops providing a category, we won't yet report it as NOT_PROVIDED | 302 // server stops providing a category, we won't yet report it as NOT_PROVIDED |
299 // while we still have non-expired snippets in it. | 303 // while we still have non-expired snippets in it. |
300 bool provided_by_server = true; | 304 bool provided_by_server = true; |
301 | 305 |
302 // All current suggestions (i.e. not dismissed ones). | 306 // All current suggestions (i.e. not dismissed ones). |
303 NTPSnippet::PtrVector snippets; | 307 NTPSnippet::PtrVector snippets; |
304 | 308 |
305 // Suggestions that the user dismissed. We keep these around until they | 309 // Suggestions that the user dismissed. We keep these around until they |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 355 |
352 // Request throttler for limiting requests to thumbnail images. | 356 // Request throttler for limiting requests to thumbnail images. |
353 RequestThrottler thumbnail_requests_throttler_; | 357 RequestThrottler thumbnail_requests_throttler_; |
354 | 358 |
355 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); | 359 DISALLOW_COPY_AND_ASSIGN(NTPSnippetsService); |
356 }; | 360 }; |
357 | 361 |
358 } // namespace ntp_snippets | 362 } // namespace ntp_snippets |
359 | 363 |
360 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ | 364 #endif // COMPONENTS_NTP_SNIPPETS_NTP_SNIPPETS_SERVICE_H_ |
OLD | NEW |