| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/settings/protocol_handlers_handler.h" | 5 #include "chrome/browser/ui/webui/settings/protocol_handlers_handler.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 void ProtocolHandlersHandler::InitializeProtocolHandlerList( | 134 void ProtocolHandlersHandler::InitializeProtocolHandlerList( |
| 135 const base::ListValue* args) { | 135 const base::ListValue* args) { |
| 136 AllowJavascript(); | 136 AllowJavascript(); |
| 137 SendHandlersEnabledValue(); | 137 SendHandlersEnabledValue(); |
| 138 UpdateHandlerList(); | 138 UpdateHandlerList(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void ProtocolHandlersHandler::SendHandlersEnabledValue() { | 141 void ProtocolHandlersHandler::SendHandlersEnabledValue() { |
| 142 CallJavascriptFunction("cr.webUIListenerCallback", | 142 CallJavascriptFunction("cr.webUIListenerCallback", |
| 143 base::StringValue("setHandlersEnabled"), | 143 base::StringValue("setHandlersEnabled"), |
| 144 base::FundamentalValue( | 144 base::Value( |
| 145 GetProtocolHandlerRegistry()->enabled())); | 145 GetProtocolHandlerRegistry()->enabled())); |
| 146 } | 146 } |
| 147 | 147 |
| 148 void ProtocolHandlersHandler::RemoveHandler(const base::ListValue* args) { | 148 void ProtocolHandlersHandler::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(); |
| 152 return; | 152 return; |
| 153 } | 153 } |
| 154 | 154 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 void ProtocolHandlersHandler::Observe( | 211 void ProtocolHandlersHandler::Observe( |
| 212 int type, | 212 int type, |
| 213 const content::NotificationSource& source, | 213 const content::NotificationSource& source, |
| 214 const content::NotificationDetails& details) { | 214 const content::NotificationDetails& details) { |
| 215 DCHECK_EQ(chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED, type); | 215 DCHECK_EQ(chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED, type); |
| 216 SendHandlersEnabledValue(); | 216 SendHandlersEnabledValue(); |
| 217 UpdateHandlerList(); | 217 UpdateHandlerList(); |
| 218 } | 218 } |
| 219 | 219 |
| 220 } // namespace settings | 220 } // namespace settings |
| OLD | NEW |