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

Side by Side Diff: components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc

Issue 2532783003: [NTP] Translateable strings for recent tabs and physical web sections. (Closed)
Patch Set: added recent tab section empty string. Created 3 years, 11 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 | components/ntp_snippets/physical_web_pages/physical_web_page_suggestions_provider.cc » ('j') | 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/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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_more_action=*/false,
115 /*has_reload_action=*/false, 115 /*has_reload_action=*/false,
116 /*has_view_all_action=*/false, 116 /*has_view_all_action=*/false,
117 /*show_if_empty=*/false, 117 /*show_if_empty=*/false,
118 l10n_util::GetStringUTF16(IDS_NTP_SUGGESTIONS_SECTION_EMPTY)); 118 l10n_util::GetStringUTF16(IDS_NTP_RECENT_TAB_SUGGESTIONS_SECTION_EMPTY));
119 // TODO(vitaliii): Replace IDS_NTP_SUGGESTIONS_SECTION_EMPTY with a
120 // category-specific string.
121 } 119 }
122 120
123 void RecentTabSuggestionsProvider::DismissSuggestion( 121 void RecentTabSuggestionsProvider::DismissSuggestion(
124 const ContentSuggestion::ID& suggestion_id) { 122 const ContentSuggestion::ID& suggestion_id) {
125 DCHECK_EQ(provided_category_, suggestion_id.category()); 123 DCHECK_EQ(provided_category_, suggestion_id.category());
126 std::set<std::string> dismissed_ids = ReadDismissedIDsFromPrefs(); 124 std::set<std::string> dismissed_ids = ReadDismissedIDsFromPrefs();
127 dismissed_ids.insert(suggestion_id.id_within_category()); 125 dismissed_ids.insert(suggestion_id.id_within_category());
128 StoreDismissedIDsToPrefs(dismissed_ids); 126 StoreDismissedIDsToPrefs(dismissed_ids);
129 } 127 }
130 128
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 } 343 }
346 344
347 void RecentTabSuggestionsProvider::StoreDismissedIDsToPrefs( 345 void RecentTabSuggestionsProvider::StoreDismissedIDsToPrefs(
348 const std::set<std::string>& dismissed_ids) { 346 const std::set<std::string>& dismissed_ids) {
349 prefs::StoreDismissedIDsToPrefs(pref_service_, 347 prefs::StoreDismissedIDsToPrefs(pref_service_,
350 prefs::kDismissedRecentOfflineTabSuggestions, 348 prefs::kDismissedRecentOfflineTabSuggestions,
351 dismissed_ids); 349 dismissed_ids);
352 } 350 }
353 351
354 } // namespace ntp_snippets 352 } // namespace ntp_snippets
OLDNEW
« no previous file with comments | « no previous file | components/ntp_snippets/physical_web_pages/physical_web_page_suggestions_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698