OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/physical_web_pages/physical_web_page_suggestio
ns_provider.h" | 5 #include "components/ntp_snippets/physical_web_pages/physical_web_page_suggestio
ns_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <memory> | 8 #include <memory> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 return category_status_; | 70 return category_status_; |
71 } | 71 } |
72 | 72 |
73 CategoryInfo PhysicalWebPageSuggestionsProvider::GetCategoryInfo( | 73 CategoryInfo PhysicalWebPageSuggestionsProvider::GetCategoryInfo( |
74 Category category) { | 74 Category category) { |
75 // TODO(vitaliii): Use the proper string once it has been agreed on. | 75 // TODO(vitaliii): Use the proper string once it has been agreed on. |
76 // TODO(vitaliii): Use a translateable string. (crbug.com/667764) | 76 // TODO(vitaliii): Use a translateable string. (crbug.com/667764) |
77 return CategoryInfo( | 77 return CategoryInfo( |
78 base::ASCIIToUTF16("Physical web pages"), | 78 base::ASCIIToUTF16("Physical web pages"), |
79 ContentSuggestionsCardLayout::FULL_CARD, | 79 ContentSuggestionsCardLayout::FULL_CARD, |
80 /*has_more_action=*/true, | 80 /*has_more_action=*/false, |
81 /*has_reload_action=*/false, | 81 /*has_reload_action=*/false, |
82 /*has_view_all_action=*/false, | 82 /*has_view_all_action=*/false, |
83 /*show_if_empty=*/false, | 83 /*show_if_empty=*/false, |
84 l10n_util::GetStringUTF16(IDS_NTP_SUGGESTIONS_SECTION_EMPTY)); | 84 l10n_util::GetStringUTF16(IDS_NTP_SUGGESTIONS_SECTION_EMPTY)); |
85 } | 85 } |
86 | 86 |
87 void PhysicalWebPageSuggestionsProvider::DismissSuggestion( | 87 void PhysicalWebPageSuggestionsProvider::DismissSuggestion( |
88 const ContentSuggestion::ID& suggestion_id) { | 88 const ContentSuggestion::ID& suggestion_id) { |
89 DCHECK_EQ(provided_category_, suggestion_id.category()); | 89 DCHECK_EQ(provided_category_, suggestion_id.category()); |
90 std::set<std::string> dismissed_ids = ReadDismissedIDsFromPrefs(); | 90 std::set<std::string> dismissed_ids = ReadDismissedIDsFromPrefs(); |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 } | 306 } |
307 | 307 |
308 void PhysicalWebPageSuggestionsProvider::StoreDismissedIDsToPrefs( | 308 void PhysicalWebPageSuggestionsProvider::StoreDismissedIDsToPrefs( |
309 const std::set<std::string>& dismissed_ids) { | 309 const std::set<std::string>& dismissed_ids) { |
310 prefs::StoreDismissedIDsToPrefs(pref_service_, | 310 prefs::StoreDismissedIDsToPrefs(pref_service_, |
311 prefs::kDismissedPhysicalWebPageSuggestions, | 311 prefs::kDismissedPhysicalWebPageSuggestions, |
312 dismissed_ids); | 312 dismissed_ids); |
313 } | 313 } |
314 | 314 |
315 } // namespace ntp_snippets | 315 } // namespace ntp_snippets |
OLD | NEW |