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

Side by Side Diff: components/ntp_snippets/physical_web_pages/physical_web_page_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
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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 physical_web_data_source_->UnregisterListener(this); 65 physical_web_data_source_->UnregisterListener(this);
66 } 66 }
67 67
68 CategoryStatus PhysicalWebPageSuggestionsProvider::GetCategoryStatus( 68 CategoryStatus PhysicalWebPageSuggestionsProvider::GetCategoryStatus(
69 Category category) { 69 Category category) {
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 return CategoryInfo(l10n_util::GetStringUTF16(
76 // TODO(vitaliii): Use a translateable string. (crbug.com/667764) 76 IDS_NTP_PHYSICAL_WEB_PAGE_SUGGESTIONS_SECTION_HEADER),
77 return CategoryInfo( 77 ContentSuggestionsCardLayout::FULL_CARD,
78 base::ASCIIToUTF16("Physical web pages"), 78 /*has_more_action=*/false,
79 ContentSuggestionsCardLayout::FULL_CARD, 79 /*has_reload_action=*/false,
80 /*has_more_action=*/false, 80 /*has_view_all_action=*/false,
81 /*has_reload_action=*/false, 81 /*show_if_empty=*/false,
82 /*has_view_all_action=*/false, 82 l10n_util::GetStringUTF16(
83 /*show_if_empty=*/false, 83 IDS_NTP_PHYSICAL_WEB_PAGE_SUGGESTIONS_SECTION_EMPTY));
84 l10n_util::GetStringUTF16(IDS_NTP_SUGGESTIONS_SECTION_EMPTY));
85 } 84 }
86 85
87 void PhysicalWebPageSuggestionsProvider::DismissSuggestion( 86 void PhysicalWebPageSuggestionsProvider::DismissSuggestion(
88 const ContentSuggestion::ID& suggestion_id) { 87 const ContentSuggestion::ID& suggestion_id) {
89 DCHECK_EQ(provided_category_, suggestion_id.category()); 88 DCHECK_EQ(provided_category_, suggestion_id.category());
90 std::set<std::string> dismissed_ids = ReadDismissedIDsFromPrefs(); 89 std::set<std::string> dismissed_ids = ReadDismissedIDsFromPrefs();
91 dismissed_ids.insert(suggestion_id.id_within_category()); 90 dismissed_ids.insert(suggestion_id.id_within_category());
92 StoreDismissedIDsToPrefs(dismissed_ids); 91 StoreDismissedIDsToPrefs(dismissed_ids);
93 } 92 }
94 93
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 298 }
300 299
301 void PhysicalWebPageSuggestionsProvider::StoreDismissedIDsToPrefs( 300 void PhysicalWebPageSuggestionsProvider::StoreDismissedIDsToPrefs(
302 const std::set<std::string>& dismissed_ids) { 301 const std::set<std::string>& dismissed_ids) {
303 prefs::StoreDismissedIDsToPrefs(pref_service_, 302 prefs::StoreDismissedIDsToPrefs(pref_service_,
304 prefs::kDismissedPhysicalWebPageSuggestions, 303 prefs::kDismissedPhysicalWebPageSuggestions,
305 dismissed_ids); 304 dismissed_ids);
306 } 305 }
307 306
308 } // namespace ntp_snippets 307 } // namespace ntp_snippets
OLDNEW
« no previous file with comments | « components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc ('k') | components/ntp_snippets_strings.grdp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698