OLD | NEW |
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 registry->GetRegisteredProtocols(&protocols); | 131 registry->GetRegisteredProtocols(&protocols); |
132 | 132 |
133 base::ListValue handlers; | 133 base::ListValue handlers; |
134 for (std::vector<std::string>::iterator protocol = protocols.begin(); | 134 for (std::vector<std::string>::iterator protocol = protocols.begin(); |
135 protocol != protocols.end(); protocol++) { | 135 protocol != protocols.end(); protocol++) { |
136 base::DictionaryValue* handler_value = new base::DictionaryValue(); | 136 base::DictionaryValue* handler_value = new base::DictionaryValue(); |
137 GetHandlersForProtocol(*protocol, handler_value); | 137 GetHandlersForProtocol(*protocol, handler_value); |
138 handlers.Append(handler_value); | 138 handlers.Append(handler_value); |
139 } | 139 } |
140 | 140 |
141 scoped_ptr<base::ListValue> ignored_handlers(new base::ListValue()); | 141 std::unique_ptr<base::ListValue> ignored_handlers(new base::ListValue()); |
142 GetIgnoredHandlers(ignored_handlers.get()); | 142 GetIgnoredHandlers(ignored_handlers.get()); |
143 web_ui()->CallJavascriptFunction("HandlerOptions.setHandlers", handlers); | 143 web_ui()->CallJavascriptFunction("HandlerOptions.setHandlers", handlers); |
144 web_ui()->CallJavascriptFunction("HandlerOptions.setIgnoredHandlers", | 144 web_ui()->CallJavascriptFunction("HandlerOptions.setIgnoredHandlers", |
145 *ignored_handlers); | 145 *ignored_handlers); |
146 } | 146 } |
147 | 147 |
148 void HandlerOptionsHandler::RemoveHandler(const base::ListValue* args) { | 148 void HandlerOptionsHandler::RemoveHandler(const base::ListValue* args) { |
149 const base::ListValue* list; | 149 const base::ListValue* list; |
150 if (!args->GetList(0, &list)) { | 150 if (!args->GetList(0, &list)) { |
151 NOTREACHED(); | 151 NOTREACHED(); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |