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

Unified Diff: chrome/browser/android/ntp/ntp_snippets_bridge.cc

Issue 1958163002: [NTP Snippets] Refactor home-grown container API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoided auto as suggested. Created 4 years, 7 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 | « no previous file | chrome/browser/ui/webui/snippets_internals_message_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/ntp/ntp_snippets_bridge.cc
diff --git a/chrome/browser/android/ntp/ntp_snippets_bridge.cc b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
index 0c8629540328d73f41b5a5d21af1e3cbdb901e48..79eb89e5207f291e58ab7e12423ff96f8fefaeab 100644
--- a/chrome/browser/android/ntp/ntp_snippets_bridge.cc
+++ b/chrome/browser/android/ntp/ntp_snippets_bridge.cc
@@ -137,16 +137,17 @@ void NTPSnippetsBridge::NTPSnippetsServiceLoaded() {
std::vector<std::string> snippets;
std::vector<int64_t> timestamps;
std::vector<std::string> publishers;
- for (const ntp_snippets::NTPSnippet& snippet : *ntp_snippets_service_) {
+ for (const std::unique_ptr<ntp_snippets::NTPSnippet>& snippet :
+ ntp_snippets_service_->snippets()) {
// The url from source_info is a url for a site that is one of the
// HOST_RESTRICT parameters, so this is preferred.
- urls.push_back(snippet.best_source().url.spec());
- amp_urls.push_back(snippet.best_source().amp_url.spec());
- titles.push_back(snippet.title());
- thumbnail_urls.push_back(snippet.salient_image_url().spec());
- snippets.push_back(snippet.snippet());
- timestamps.push_back(snippet.publish_date().ToJavaTime());
- publishers.push_back(snippet.best_source().publisher_name);
+ urls.push_back(snippet->best_source().url.spec());
+ amp_urls.push_back(snippet->best_source().amp_url.spec());
+ titles.push_back(snippet->title());
+ thumbnail_urls.push_back(snippet->salient_image_url().spec());
+ snippets.push_back(snippet->snippet());
+ timestamps.push_back(snippet->publish_date().ToJavaTime());
+ publishers.push_back(snippet->best_source().publisher_name);
}
JNIEnv* env = base::android::AttachCurrentThread();
« no previous file with comments | « no previous file | chrome/browser/ui/webui/snippets_internals_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698