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

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

Issue 518673003: Add policy indicator for protocol handlers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes nits Created 6 years, 3 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 "is_default_handler_set_by_user",
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698