OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/policy/core/common/policy_loader_ios.h" | 5 #include "components/policy/core/common/policy_loader_ios.h" |
6 | 6 |
7 #import <Foundation/Foundation.h> | 7 #import <Foundation/Foundation.h> |
8 #import <UIKit/UIKit.h> | 8 #import <UIKit/UIKit.h> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 // static | 170 // static |
171 void PolicyLoaderIOS::LoadNSDictionaryToPolicyBundle(NSDictionary* dictionary, | 171 void PolicyLoaderIOS::LoadNSDictionaryToPolicyBundle(NSDictionary* dictionary, |
172 PolicyBundle* bundle) { | 172 PolicyBundle* bundle) { |
173 // NSDictionary is toll-free bridged to CFDictionaryRef, which is a | 173 // NSDictionary is toll-free bridged to CFDictionaryRef, which is a |
174 // CFPropertyListRef. | 174 // CFPropertyListRef. |
175 scoped_ptr<base::Value> value = | 175 scoped_ptr<base::Value> value = |
176 PropertyToValue(static_cast<CFPropertyListRef>(dictionary)); | 176 PropertyToValue(static_cast<CFPropertyListRef>(dictionary)); |
177 base::DictionaryValue* dict = NULL; | 177 base::DictionaryValue* dict = NULL; |
178 if (value && value->GetAsDictionary(&dict)) { | 178 if (value && value->GetAsDictionary(&dict)) { |
179 PolicyMap& map = bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, "")); | 179 PolicyMap& map = bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, "")); |
180 map.LoadFrom(dict, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, | 180 map.LoadFrom(dict, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE); |
181 POLICY_SOURCE_PLATFORM); | |
182 } | 181 } |
183 } | 182 } |
184 | 183 |
185 } // namespace policy | 184 } // namespace policy |
OLD | NEW |