Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: components/ntp_snippets/physical_web_pages/physical_web_page_suggestions_provider.cc

Issue 2590143002: [NTP::PhysicalWeb] Do not show "More" button. (Closed)
Patch Set: Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698