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

Side by Side Diff: chrome/browser/ui/webui/invalidations_message_handler.cc

Issue 2030013003: Remove ListValue::Append(new {Fundamental,String}Value(...)) pattern in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chrome/browser/ui/webui/invalidations_message_handler.h" 5 #include "chrome/browser/ui/webui/invalidations_message_handler.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h" 8 #include "chrome/browser/invalidation/profile_invalidation_provider_factory.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "components/invalidation/impl/invalidation_logger.h" 10 #include "components/invalidation/impl/invalidation_logger.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 if (logger_) 69 if (logger_)
70 logger_->EmitContent(); 70 logger_->EmitContent();
71 } 71 }
72 72
73 void InvalidationsMessageHandler::OnRegistrationChange( 73 void InvalidationsMessageHandler::OnRegistrationChange(
74 const std::multiset<std::string>& registered_handlers) { 74 const std::multiset<std::string>& registered_handlers) {
75 base::ListValue list_of_handlers; 75 base::ListValue list_of_handlers;
76 for (std::multiset<std::string>::const_iterator it = 76 for (std::multiset<std::string>::const_iterator it =
77 registered_handlers.begin(); 77 registered_handlers.begin();
78 it != registered_handlers.end(); ++it) { 78 it != registered_handlers.end(); ++it) {
79 list_of_handlers.Append(new base::StringValue(*it)); 79 list_of_handlers.AppendString(*it);
80 } 80 }
81 web_ui()->CallJavascriptFunction("chrome.invalidations.updateHandlers", 81 web_ui()->CallJavascriptFunction("chrome.invalidations.updateHandlers",
82 list_of_handlers); 82 list_of_handlers);
83 } 83 }
84 84
85 void InvalidationsMessageHandler::OnStateChange( 85 void InvalidationsMessageHandler::OnStateChange(
86 const syncer::InvalidatorState& new_state, 86 const syncer::InvalidatorState& new_state,
87 const base::Time& last_changed_timestamp) { 87 const base::Time& last_changed_timestamp) {
88 std::string state(syncer::InvalidatorStateToString(new_state)); 88 std::string state(syncer::InvalidatorStateToString(new_state));
89 web_ui()->CallJavascriptFunction( 89 web_ui()->CallJavascriptFunction(
(...skipping 27 matching lines...) Expand all
117 new_invalidations.ToValue(); 117 new_invalidations.ToValue();
118 web_ui()->CallJavascriptFunction("chrome.invalidations.logInvalidations", 118 web_ui()->CallJavascriptFunction("chrome.invalidations.logInvalidations",
119 *invalidations_list); 119 *invalidations_list);
120 } 120 }
121 121
122 void InvalidationsMessageHandler::OnDetailedStatus( 122 void InvalidationsMessageHandler::OnDetailedStatus(
123 const base::DictionaryValue& network_details) { 123 const base::DictionaryValue& network_details) {
124 web_ui()->CallJavascriptFunction("chrome.invalidations.updateDetailedStatus", 124 web_ui()->CallJavascriptFunction("chrome.invalidations.updateDetailedStatus",
125 network_details); 125 network_details);
126 } 126 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698