Chromium Code Reviews| 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 "registered_by_user", | |
|
bartfab (slow)
2014/09/01 14:56:44
Nit: It is hard to figure out what the exact seman
kaliamoorthi
2014/09/01 15:11:58
Done.
| |
| 114 registry->IsRegisteredByUser(registry->GetHandlerFor(protocol))); | |
| 115 handlers_value->SetBoolean("has_policy_recommendations", | |
| 116 registry->HasPolicyRegisteredHandler(protocol)); | |
| 112 | 117 |
| 113 base::ListValue* handlers_list = new base::ListValue(); | 118 base::ListValue* handlers_list = new base::ListValue(); |
| 114 GetHandlersAsListValue(registry->GetHandlersFor(protocol), handlers_list); | 119 GetHandlersAsListValue(registry->GetHandlersFor(protocol), handlers_list); |
| 115 handlers_value->Set("handlers", handlers_list); | 120 handlers_value->Set("handlers", handlers_list); |
| 116 } | 121 } |
| 117 | 122 |
| 118 void HandlerOptionsHandler::GetIgnoredHandlers(base::ListValue* handlers) { | 123 void HandlerOptionsHandler::GetIgnoredHandlers(base::ListValue* handlers) { |
| 119 ProtocolHandlerRegistry* registry = GetProtocolHandlerRegistry(); | 124 ProtocolHandlerRegistry* registry = GetProtocolHandlerRegistry(); |
| 120 ProtocolHandlerRegistry::ProtocolHandlerList ignored_handlers = | 125 ProtocolHandlerRegistry::ProtocolHandlerList ignored_handlers = |
| 121 registry->GetIgnoredHandlers(); | 126 registry->GetIgnoredHandlers(); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 208 int type, | 213 int type, |
| 209 const content::NotificationSource& source, | 214 const content::NotificationSource& source, |
| 210 const content::NotificationDetails& details) { | 215 const content::NotificationDetails& details) { |
| 211 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED) | 216 if (type == chrome::NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED) |
| 212 UpdateHandlerList(); | 217 UpdateHandlerList(); |
| 213 else | 218 else |
| 214 NOTREACHED(); | 219 NOTREACHED(); |
| 215 } | 220 } |
| 216 | 221 |
| 217 } // namespace options | 222 } // namespace options |
| OLD | NEW |