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/policy_ui_handler.h" | 5 #include "chrome/browser/ui/webui/policy_ui_handler.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 | 183 |
184 scoped_ptr<base::Value> copy(value->DeepCopy()); | 184 scoped_ptr<base::Value> copy(value->DeepCopy()); |
185 base::ListValue* list = NULL; | 185 base::ListValue* list = NULL; |
186 if (copy->GetAsList(&list)) { | 186 if (copy->GetAsList(&list)) { |
187 for (size_t i = 0; i < list->GetSize(); ++i) { | 187 for (size_t i = 0; i < list->GetSize(); ++i) { |
188 if (list->GetDictionary(i, &dict)) | 188 if (list->GetDictionary(i, &dict)) |
189 list->Set(i, DictionaryToJSONString(*dict).release()); | 189 list->Set(i, DictionaryToJSONString(*dict).release()); |
190 } | 190 } |
191 } | 191 } |
192 | 192 |
193 return copy.Pass(); | 193 return copy; |
194 } | 194 } |
195 | 195 |
196 } // namespace | 196 } // namespace |
197 | 197 |
198 // An interface for querying the status of cloud policy. | 198 // An interface for querying the status of cloud policy. |
199 class CloudPolicyStatusProvider { | 199 class CloudPolicyStatusProvider { |
200 public: | 200 public: |
201 CloudPolicyStatusProvider(); | 201 CloudPolicyStatusProvider(); |
202 virtual ~CloudPolicyStatusProvider(); | 202 virtual ~CloudPolicyStatusProvider(); |
203 | 203 |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
739 } | 739 } |
740 | 740 |
741 void PolicyUIHandler::OnRefreshPoliciesDone() const { | 741 void PolicyUIHandler::OnRefreshPoliciesDone() const { |
742 web_ui()->CallJavascriptFunction("policy.Page.reloadPoliciesDone"); | 742 web_ui()->CallJavascriptFunction("policy.Page.reloadPoliciesDone"); |
743 } | 743 } |
744 | 744 |
745 policy::PolicyService* PolicyUIHandler::GetPolicyService() const { | 745 policy::PolicyService* PolicyUIHandler::GetPolicyService() const { |
746 return policy::ProfilePolicyConnectorFactory::GetForBrowserContext( | 746 return policy::ProfilePolicyConnectorFactory::GetForBrowserContext( |
747 web_ui()->GetWebContents()->GetBrowserContext())->policy_service(); | 747 web_ui()->GetWebContents()->GetBrowserContext())->policy_service(); |
748 } | 748 } |
OLD | NEW |