| 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 #include "components/ntp_snippets/remote/ntp_snippets_service.h" | 5 #include "components/ntp_snippets/remote/ntp_snippets_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <iterator> | 8 #include <iterator> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 CategoryStatus NTPSnippetsService::GetCategoryStatus(Category category) { | 310 CategoryStatus NTPSnippetsService::GetCategoryStatus(Category category) { |
| 311 DCHECK(base::ContainsKey(categories_, category)); | 311 DCHECK(base::ContainsKey(categories_, category)); |
| 312 return categories_[category].status; | 312 return categories_[category].status; |
| 313 } | 313 } |
| 314 | 314 |
| 315 CategoryInfo NTPSnippetsService::GetCategoryInfo(Category category) { | 315 CategoryInfo NTPSnippetsService::GetCategoryInfo(Category category) { |
| 316 DCHECK(base::ContainsKey(categories_, category)); | 316 DCHECK(base::ContainsKey(categories_, category)); |
| 317 const CategoryContent& content = categories_[category]; | 317 const CategoryContent& content = categories_[category]; |
| 318 return CategoryInfo( | 318 return CategoryInfo( |
| 319 content.localized_title, ContentSuggestionsCardLayout::FULL_CARD, | 319 content.localized_title, ContentSuggestionsCardLayout::FULL_CARD, |
| 320 /*has_more_button=*/false, | 320 /*has_more_action=*/false, |
| 321 /*has_reload_action=*/true, |
| 322 /*has_view_all_action=*/false, |
| 321 /*show_if_empty=*/true, | 323 /*show_if_empty=*/true, |
| 322 l10n_util::GetStringUTF16(IDS_NTP_ARTICLE_SUGGESTIONS_SECTION_EMPTY)); | 324 l10n_util::GetStringUTF16(IDS_NTP_ARTICLE_SUGGESTIONS_SECTION_EMPTY)); |
| 323 } | 325 } |
| 324 | 326 |
| 325 void NTPSnippetsService::DismissSuggestion( | 327 void NTPSnippetsService::DismissSuggestion( |
| 326 const ContentSuggestion::ID& suggestion_id) { | 328 const ContentSuggestion::ID& suggestion_id) { |
| 327 if (!ready()) | 329 if (!ready()) |
| 328 return; | 330 return; |
| 329 | 331 |
| 330 DCHECK(base::ContainsKey(categories_, suggestion_id.category())); | 332 DCHECK(base::ContainsKey(categories_, suggestion_id.category())); |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1112 } | 1114 } |
| 1113 | 1115 |
| 1114 NTPSnippetsService::CategoryContent::CategoryContent() = default; | 1116 NTPSnippetsService::CategoryContent::CategoryContent() = default; |
| 1115 NTPSnippetsService::CategoryContent::CategoryContent(CategoryContent&&) = | 1117 NTPSnippetsService::CategoryContent::CategoryContent(CategoryContent&&) = |
| 1116 default; | 1118 default; |
| 1117 NTPSnippetsService::CategoryContent::~CategoryContent() = default; | 1119 NTPSnippetsService::CategoryContent::~CategoryContent() = default; |
| 1118 NTPSnippetsService::CategoryContent& NTPSnippetsService::CategoryContent:: | 1120 NTPSnippetsService::CategoryContent& NTPSnippetsService::CategoryContent:: |
| 1119 operator=(CategoryContent&&) = default; | 1121 operator=(CategoryContent&&) = default; |
| 1120 | 1122 |
| 1121 } // namespace ntp_snippets | 1123 } // namespace ntp_snippets |
| OLD | NEW |