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

Side by Side Diff: chrome/browser/ui/webui/options/handler_options_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/options/handler_options_handler.h" 5 #include "chrome/browser/ui/webui/options/handler_options_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 return ProtocolHandlerRegistryFactory::GetForBrowserContext( 83 return ProtocolHandlerRegistryFactory::GetForBrowserContext(
84 Profile::FromWebUI(web_ui())); 84 Profile::FromWebUI(web_ui()));
85 } 85 }
86 86
87 static void GetHandlersAsListValue( 87 static void GetHandlersAsListValue(
88 const ProtocolHandlerRegistry::ProtocolHandlerList& handlers, 88 const ProtocolHandlerRegistry::ProtocolHandlerList& handlers,
89 base::ListValue* handler_list) { 89 base::ListValue* handler_list) {
90 ProtocolHandlerRegistry::ProtocolHandlerList::const_iterator handler; 90 ProtocolHandlerRegistry::ProtocolHandlerList::const_iterator handler;
91 for (handler = handlers.begin(); handler != handlers.end(); ++handler) { 91 for (handler = handlers.begin(); handler != handlers.end(); ++handler) {
92 base::ListValue* handlerValue = new base::ListValue(); 92 base::ListValue* handlerValue = new base::ListValue();
93 handlerValue->Append(new base::StringValue(handler->protocol())); 93 handlerValue->AppendString(handler->protocol());
94 handlerValue->Append(new base::StringValue(handler->url().spec())); 94 handlerValue->AppendString(handler->url().spec());
95 handlerValue->Append(new base::StringValue(handler->url().host())); 95 handlerValue->AppendString(handler->url().host());
96 handler_list->Append(handlerValue); 96 handler_list->Append(handlerValue);
97 } 97 }
98 } 98 }
99 99
100 void HandlerOptionsHandler::GetHandlersForProtocol( 100 void HandlerOptionsHandler::GetHandlersForProtocol(
101 const std::string& protocol, 101 const std::string& protocol,
102 base::DictionaryValue* handlers_value) { 102 base::DictionaryValue* handlers_value) {
103 ProtocolHandlerRegistry* registry = GetProtocolHandlerRegistry(); 103 ProtocolHandlerRegistry* registry = GetProtocolHandlerRegistry();
104 // The items which are to be written into |handlers_value| are also described 104 // The items which are to be written into |handlers_value| are also described
105 // in chrome/browser/resources/options/handler_options.js in @typedef 105 // in chrome/browser/resources/options/handler_options.js in @typedef
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 int type, 211 int type,
212 const content::NotificationSource& source, 212 const content::NotificationSource& source,
213 const content::NotificationDetails& details) { 213 const content::NotificationDetails& details) {
214 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED) 214 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED)
215 UpdateHandlerList(); 215 UpdateHandlerList();
216 else 216 else
217 NOTREACHED(); 217 NOTREACHED();
218 } 218 }
219 219
220 } // namespace options 220 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698