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

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: Updated client code. 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
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..215e091a3985984f6a75e1ae262be2fe895b91b9 100644
--- a/chrome/browser/ui/webui/snippets_internals_message_handler.cc
+++ b/chrome/browser/ui/webui/snippets_internals_message_handler.cc
@@ -177,8 +177,8 @@ 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 (auto& snippet : ntp_snippets_service_->snippets())
Bernhard Bauer 2016/05/10 14:48:56 Make this const as well? Also, use the actual type
mastiz 2016/05/10 15:59:52 Done.
+ snippets_list->Append(PrepareSnippet(*snippet, index++, false));
base::DictionaryValue result;
result.Set("list", std::move(snippets_list));
@@ -194,7 +194,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;

Powered by Google App Engine
This is Rietveld 408576698