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 #include <stddef.h> | 8 #include <stddef.h> |
9 #import <UIKit/UIKit.h> | 9 #import <UIKit/UIKit.h> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/mac/scoped_nsobject.h" | 14 #include "base/mac/scoped_nsobject.h" |
15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
16 #include "base/sequenced_task_runner.h" | 16 #include "base/sequenced_task_runner.h" |
17 #include "components/policy/core/common/mac_util.h" | 17 #include "components/policy/core/common/mac_util.h" |
18 #include "components/policy/core/common/policy_bundle.h" | 18 #include "components/policy/core/common/policy_bundle.h" |
19 #include "components/policy/core/common/policy_map.h" | 19 #include "components/policy/core/common/policy_map.h" |
20 #include "components/policy/core/common/policy_namespace.h" | 20 #include "components/policy/core/common/policy_namespace.h" |
21 #include "policy/policy_constants.h" | 21 #include "components/policy/policy_constants.h" |
22 | 22 |
23 // This policy loader loads a managed app configuration from the NSUserDefaults. | 23 // This policy loader loads a managed app configuration from the NSUserDefaults. |
24 // For example code from Apple see: | 24 // For example code from Apple see: |
25 // https://developer.apple.com/library/ios/samplecode/sc2279/Introduction/Intro.
html | 25 // https://developer.apple.com/library/ios/samplecode/sc2279/Introduction/Intro.
html |
26 // For an introduction to the API see session 301 from WWDC 2013, | 26 // For an introduction to the API see session 301 from WWDC 2013, |
27 // "Extending Your Apps for Enterprise and Education Use": | 27 // "Extending Your Apps for Enterprise and Education Use": |
28 // https://developer.apple.com/videos/wwdc/2013/?id=301 | 28 // https://developer.apple.com/videos/wwdc/2013/?id=301 |
29 | 29 |
30 namespace { | 30 namespace { |
31 | 31 |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 PropertyToValue(static_cast<CFPropertyListRef>(dictionary)); | 177 PropertyToValue(static_cast<CFPropertyListRef>(dictionary)); |
178 base::DictionaryValue* dict = NULL; | 178 base::DictionaryValue* dict = NULL; |
179 if (value && value->GetAsDictionary(&dict)) { | 179 if (value && value->GetAsDictionary(&dict)) { |
180 PolicyMap& map = bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, "")); | 180 PolicyMap& map = bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, "")); |
181 map.LoadFrom(dict, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, | 181 map.LoadFrom(dict, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, |
182 POLICY_SOURCE_PLATFORM); | 182 POLICY_SOURCE_PLATFORM); |
183 } | 183 } |
184 } | 184 } |
185 | 185 |
186 } // namespace policy | 186 } // namespace policy |
OLD | NEW |