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

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

Issue 1995113002: Rename WebUI::CallJavascriptFunction to WebUI::CallJavascriptFunctionUnsafe (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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 std::unique_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()->CallJavascriptFunctionUnsafe("HandlerOptions.setHandlers",
144 web_ui()->CallJavascriptFunction("HandlerOptions.setIgnoredHandlers", 144 handlers);
145 *ignored_handlers); 145 web_ui()->CallJavascriptFunctionUnsafe("HandlerOptions.setIgnoredHandlers",
146 *ignored_handlers);
146 } 147 }
147 148
148 void HandlerOptionsHandler::RemoveHandler(const base::ListValue* args) { 149 void HandlerOptionsHandler::RemoveHandler(const base::ListValue* args) {
149 const base::ListValue* list; 150 const base::ListValue* list;
150 if (!args->GetList(0, &list)) { 151 if (!args->GetList(0, &list)) {
151 NOTREACHED(); 152 NOTREACHED();
152 return; 153 return;
153 } 154 }
154 155
155 ProtocolHandler handler(ParseHandlerFromArgs(list)); 156 ProtocolHandler handler(ParseHandlerFromArgs(list));
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 int type, 212 int type,
212 const content::NotificationSource& source, 213 const content::NotificationSource& source,
213 const content::NotificationDetails& details) { 214 const content::NotificationDetails& details) {
214 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED) 215 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED)
215 UpdateHandlerList(); 216 UpdateHandlerList();
216 else 217 else
217 NOTREACHED(); 218 NOTREACHED();
218 } 219 }
219 220
220 } // namespace options 221 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698