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

Unified Diff: components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc

Issue 2197223002: Use base::string16 for user-visible texts in ContentSuggestion (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/ntp_snippets/ntp_snippets_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc
diff --git a/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc b/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc
index 2cc197268d71c0297a2ae0743e65fef4d84b5d1d..eec605b00b188d6e1d32d9c7ec1f12e34821759a 100644
--- a/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc
+++ b/components/ntp_snippets/offline_pages/offline_page_suggestions_provider.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/utf_string_conversions.h"
using offline_pages::MultipleOfflinePageItemResult;
using offline_pages::OfflinePageModel;
@@ -119,10 +120,10 @@ void OfflinePageSuggestionsProvider::OnOfflinePagesLoaded(
// TODO(pke): Sort my most recently visited and only keep the top one of
// multiple entries for the same URL.
// TODO(pke): Get more reasonable data from the OfflinePageModel here.
- suggestion.set_title(item.url.spec());
- suggestion.set_snippet_text(std::string());
+ suggestion.set_title(base::UTF8ToUTF16(item.url.spec()));
+ suggestion.set_snippet_text(base::string16());
suggestion.set_publish_date(item.creation_time);
- suggestion.set_publisher_name(item.url.host());
+ suggestion.set_publisher_name(base::UTF8ToUTF16(item.url.host()));
suggestions.emplace_back(std::move(suggestion));
if (suggestions.size() == kMaxSuggestionsCount)
break;
« no previous file with comments | « components/ntp_snippets/ntp_snippets_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698