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

Unified Diff: chrome/browser/ui/webui/snippets_internals_message_handler.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 | « chrome/browser/android/ntp/ntp_snippets_bridge.cc ('k') | components/components_tests.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/snippets_internals_message_handler.cc
diff --git a/chrome/browser/ui/webui/snippets_internals_message_handler.cc b/chrome/browser/ui/webui/snippets_internals_message_handler.cc
index 45d30e23d9176985afe26428309d0cce8151032e..9c9f371e17fd9975b1a382aef6c95138fb743c25 100644
--- a/chrome/browser/ui/webui/snippets_internals_message_handler.cc
+++ b/chrome/browser/ui/webui/snippets_internals_message_handler.cc
@@ -177,8 +177,9 @@ void SnippetsInternalsMessageHandler::SendSnippets() {
std::unique_ptr<base::ListValue> snippets_list(new base::ListValue);
int index = 0;
- for (auto& snippet : *ntp_snippets_service_)
- snippets_list->Append(PrepareSnippet(snippet, index++, false));
+ for (const std::unique_ptr<ntp_snippets::NTPSnippet>& snippet :
+ ntp_snippets_service_->snippets())
+ snippets_list->Append(PrepareSnippet(*snippet, index++, false));
base::DictionaryValue result;
result.Set("list", std::move(snippets_list));
@@ -194,7 +195,7 @@ void SnippetsInternalsMessageHandler::SendDiscardedSnippets() {
std::unique_ptr<base::ListValue> snippets_list(new base::ListValue);
int index = 0;
- for (auto& snippet : ntp_snippets_service_->discarded_snippets())
+ for (const auto& snippet : ntp_snippets_service_->discarded_snippets())
snippets_list->Append(PrepareSnippet(*snippet, index++, true));
base::DictionaryValue result;
« no previous file with comments | « chrome/browser/android/ntp/ntp_snippets_bridge.cc ('k') | components/components_tests.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698