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

Side by Side Diff: chrome/browser/ui/webui/options/handler_options_handler.cc

Issue 11415226: webui/options: Do not use Value::CreateStringValue. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix typo Created 8 years 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 | Annotate | Revision Log
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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 ProtocolHandlerRegistry* HandlerOptionsHandler::GetProtocolHandlerRegistry() { 85 ProtocolHandlerRegistry* HandlerOptionsHandler::GetProtocolHandlerRegistry() {
86 return Profile::FromWebUI(web_ui())->GetProtocolHandlerRegistry(); 86 return Profile::FromWebUI(web_ui())->GetProtocolHandlerRegistry();
87 } 87 }
88 88
89 static void GetHandlersAsListValue( 89 static void GetHandlersAsListValue(
90 const ProtocolHandlerRegistry::ProtocolHandlerList& handlers, 90 const ProtocolHandlerRegistry::ProtocolHandlerList& handlers,
91 ListValue* handler_list) { 91 ListValue* handler_list) {
92 ProtocolHandlerRegistry::ProtocolHandlerList::const_iterator handler; 92 ProtocolHandlerRegistry::ProtocolHandlerList::const_iterator handler;
93 for (handler = handlers.begin(); handler != handlers.end(); ++handler) { 93 for (handler = handlers.begin(); handler != handlers.end(); ++handler) {
94 ListValue* handlerValue = new ListValue(); 94 ListValue* handlerValue = new ListValue();
95 handlerValue->Append(Value::CreateStringValue(handler->protocol())); 95 handlerValue->Append(new base::StringValue(handler->protocol()));
96 handlerValue->Append(Value::CreateStringValue(handler->url().spec())); 96 handlerValue->Append(new base::StringValue(handler->url().spec()));
97 handlerValue->Append(Value::CreateStringValue(handler->title())); 97 handlerValue->Append(new base::StringValue(handler->title()));
98 handler_list->Append(handlerValue); 98 handler_list->Append(handlerValue);
99 } 99 }
100 } 100 }
101 101
102 void HandlerOptionsHandler::GetHandlersForProtocol( 102 void HandlerOptionsHandler::GetHandlersForProtocol(
103 const std::string& protocol, 103 const std::string& protocol,
104 DictionaryValue* handlers_value) { 104 DictionaryValue* handlers_value) {
105 ProtocolHandlerRegistry* registry = GetProtocolHandlerRegistry(); 105 ProtocolHandlerRegistry* registry = GetProtocolHandlerRegistry();
106 handlers_value->SetString("protocol", protocol); 106 handlers_value->SetString("protocol", protocol);
107 handlers_value->SetInteger("default_handler", 107 handlers_value->SetInteger("default_handler",
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
208 int type, 208 int type,
209 const content::NotificationSource& source, 209 const content::NotificationSource& source,
210 const content::NotificationDetails& details) { 210 const content::NotificationDetails& details) {
211 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED) 211 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED)
212 UpdateHandlerList(); 212 UpdateHandlerList();
213 else 213 else
214 NOTREACHED(); 214 NOTREACHED();
215 } 215 }
216 216
217 } // namespace options 217 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/font_settings_handler.cc ('k') | chrome/browser/ui/webui/options/manage_profile_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698