| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 void HandlerOptionsHandler::GetHandlersForProtocol( | 105 void HandlerOptionsHandler::GetHandlersForProtocol( |
| 106 const std::string& protocol, | 106 const std::string& protocol, |
| 107 base::DictionaryValue* handlers_value) { | 107 base::DictionaryValue* handlers_value) { |
| 108 ProtocolHandlerRegistry* registry = GetProtocolHandlerRegistry(); | 108 ProtocolHandlerRegistry* registry = GetProtocolHandlerRegistry(); |
| 109 handlers_value->SetString("protocol", protocol); | 109 handlers_value->SetString("protocol", protocol); |
| 110 handlers_value->SetInteger("default_handler", | 110 handlers_value->SetInteger("default_handler", |
| 111 registry->GetHandlerIndex(protocol)); | 111 registry->GetHandlerIndex(protocol)); |
| 112 handlers_value->SetBoolean( |
| 113 "policy_controlled", |
| 114 !registry->IsRegisteredByUser(registry->GetHandlerFor(protocol))); |
| 112 | 115 |
| 113 base::ListValue* handlers_list = new base::ListValue(); | 116 base::ListValue* handlers_list = new base::ListValue(); |
| 114 GetHandlersAsListValue(registry->GetHandlersFor(protocol), handlers_list); | 117 GetHandlersAsListValue(registry->GetHandlersFor(protocol), handlers_list); |
| 115 handlers_value->Set("handlers", handlers_list); | 118 handlers_value->Set("handlers", handlers_list); |
| 116 } | 119 } |
| 117 | 120 |
| 118 void HandlerOptionsHandler::GetIgnoredHandlers(base::ListValue* handlers) { | 121 void HandlerOptionsHandler::GetIgnoredHandlers(base::ListValue* handlers) { |
| 119 ProtocolHandlerRegistry* registry = GetProtocolHandlerRegistry(); | 122 ProtocolHandlerRegistry* registry = GetProtocolHandlerRegistry(); |
| 120 ProtocolHandlerRegistry::ProtocolHandlerList ignored_handlers = | 123 ProtocolHandlerRegistry::ProtocolHandlerList ignored_handlers = |
| 121 registry->GetIgnoredHandlers(); | 124 registry->GetIgnoredHandlers(); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 int type, | 211 int type, |
| 209 const content::NotificationSource& source, | 212 const content::NotificationSource& source, |
| 210 const content::NotificationDetails& details) { | 213 const content::NotificationDetails& details) { |
| 211 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED) | 214 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED) |
| 212 UpdateHandlerList(); | 215 UpdateHandlerList(); |
| 213 else | 216 else |
| 214 NOTREACHED(); | 217 NOTREACHED(); |
| 215 } | 218 } |
| 216 | 219 |
| 217 } // namespace options | 220 } // namespace options |
| OLD | NEW |