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

Side by Side Diff: components/ntp_snippets/offline_pages/recent_tab_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/offline_pages/recent_tab_suggestions_provider. h" 5 #include "components/ntp_snippets/offline_pages/recent_tab_suggestions_provider. h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 } 104 }
105 NOTREACHED() << "Unknown category " << category.id(); 105 NOTREACHED() << "Unknown category " << category.id();
106 return CategoryStatus::NOT_PROVIDED; 106 return CategoryStatus::NOT_PROVIDED;
107 } 107 }
108 108
109 CategoryInfo RecentTabSuggestionsProvider::GetCategoryInfo(Category category) { 109 CategoryInfo RecentTabSuggestionsProvider::GetCategoryInfo(Category category) {
110 DCHECK_EQ(provided_category_, category); 110 DCHECK_EQ(provided_category_, category);
111 return CategoryInfo( 111 return CategoryInfo(
112 l10n_util::GetStringUTF16(IDS_NTP_RECENT_TAB_SUGGESTIONS_SECTION_HEADER), 112 l10n_util::GetStringUTF16(IDS_NTP_RECENT_TAB_SUGGESTIONS_SECTION_HEADER),
113 ContentSuggestionsCardLayout::MINIMAL_CARD, 113 ContentSuggestionsCardLayout::MINIMAL_CARD,
114 /*has_more_action=*/false, 114 /*has_fetch_action=*/false,
115 /*has_reload_action=*/false,
116 /*has_view_all_action=*/false, 115 /*has_view_all_action=*/false,
117 /*show_if_empty=*/false, 116 /*show_if_empty=*/false,
118 l10n_util::GetStringUTF16(IDS_NTP_RECENT_TAB_SUGGESTIONS_SECTION_EMPTY)); 117 l10n_util::GetStringUTF16(IDS_NTP_RECENT_TAB_SUGGESTIONS_SECTION_EMPTY));
119 } 118 }
120 119
121 void RecentTabSuggestionsProvider::DismissSuggestion( 120 void RecentTabSuggestionsProvider::DismissSuggestion(
122 const ContentSuggestion::ID& suggestion_id) { 121 const ContentSuggestion::ID& suggestion_id) {
123 DCHECK_EQ(provided_category_, suggestion_id.category()); 122 DCHECK_EQ(provided_category_, suggestion_id.category());
124 std::set<std::string> dismissed_ids = ReadDismissedIDsFromPrefs(); 123 std::set<std::string> dismissed_ids = ReadDismissedIDsFromPrefs();
125 dismissed_ids.insert(suggestion_id.id_within_category()); 124 dismissed_ids.insert(suggestion_id.id_within_category());
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 } 345 }
347 346
348 void RecentTabSuggestionsProvider::StoreDismissedIDsToPrefs( 347 void RecentTabSuggestionsProvider::StoreDismissedIDsToPrefs(
349 const std::set<std::string>& dismissed_ids) { 348 const std::set<std::string>& dismissed_ids) {
350 prefs::StoreDismissedIDsToPrefs(pref_service_, 349 prefs::StoreDismissedIDsToPrefs(pref_service_,
351 prefs::kDismissedRecentOfflineTabSuggestions, 350 prefs::kDismissedRecentOfflineTabSuggestions,
352 dismissed_ids); 351 dismissed_ids);
353 } 352 }
354 353
355 } // namespace ntp_snippets 354 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698