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

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

Issue 2663313002: 📰 Merge the has_fetch_more and has_reload actions (Closed)
Patch Set: rebase Created 3 years, 10 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
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 CategoryStatus PhysicalWebPageSuggestionsProvider::GetCategoryStatus( 110 CategoryStatus PhysicalWebPageSuggestionsProvider::GetCategoryStatus(
111 Category category) { 111 Category category) {
112 return category_status_; 112 return category_status_;
113 } 113 }
114 114
115 CategoryInfo PhysicalWebPageSuggestionsProvider::GetCategoryInfo( 115 CategoryInfo PhysicalWebPageSuggestionsProvider::GetCategoryInfo(
116 Category category) { 116 Category category) {
117 return CategoryInfo(l10n_util::GetStringUTF16( 117 return CategoryInfo(l10n_util::GetStringUTF16(
118 IDS_NTP_PHYSICAL_WEB_PAGE_SUGGESTIONS_SECTION_HEADER), 118 IDS_NTP_PHYSICAL_WEB_PAGE_SUGGESTIONS_SECTION_HEADER),
119 ContentSuggestionsCardLayout::FULL_CARD, 119 ContentSuggestionsCardLayout::FULL_CARD,
120 /*has_more_action=*/false, 120 /*has_fetch_action=*/false,
121 /*has_reload_action=*/false,
122 /*has_view_all_action=*/false, 121 /*has_view_all_action=*/false,
123 /*show_if_empty=*/false, 122 /*show_if_empty=*/false,
124 l10n_util::GetStringUTF16( 123 l10n_util::GetStringUTF16(
125 IDS_NTP_PHYSICAL_WEB_PAGE_SUGGESTIONS_SECTION_EMPTY)); 124 IDS_NTP_PHYSICAL_WEB_PAGE_SUGGESTIONS_SECTION_EMPTY));
126 } 125 }
127 126
128 void PhysicalWebPageSuggestionsProvider::DismissSuggestion( 127 void PhysicalWebPageSuggestionsProvider::DismissSuggestion(
129 const ContentSuggestion::ID& suggestion_id) { 128 const ContentSuggestion::ID& suggestion_id) {
130 DCHECK_EQ(provided_category_, suggestion_id.category()); 129 DCHECK_EQ(provided_category_, suggestion_id.category());
131 std::set<std::string> dismissed_ids = ReadDismissedIDsFromPrefs(); 130 std::set<std::string> dismissed_ids = ReadDismissedIDsFromPrefs();
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 359 }
361 360
362 void PhysicalWebPageSuggestionsProvider::StoreDismissedIDsToPrefs( 361 void PhysicalWebPageSuggestionsProvider::StoreDismissedIDsToPrefs(
363 const std::set<std::string>& dismissed_ids) { 362 const std::set<std::string>& dismissed_ids) {
364 prefs::StoreDismissedIDsToPrefs(pref_service_, 363 prefs::StoreDismissedIDsToPrefs(pref_service_,
365 prefs::kDismissedPhysicalWebPageSuggestions, 364 prefs::kDismissedPhysicalWebPageSuggestions,
366 dismissed_ids); 365 dismissed_ids);
367 } 366 }
368 367
369 } // namespace ntp_snippets 368 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698