Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / components / policy / core / common / mac_util.h
blobbafb7b2a851de507b4ad35a5b6f78b1132cd7047
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
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_POLICY_CORE_COMMON_MAC_UTIL_H_
6 #define COMPONENTS_POLICY_CORE_COMMON_MAC_UTIL_H_
8 #include <CoreFoundation/CoreFoundation.h>
10 #include "base/memory/scoped_ptr.h"
11 #include "components/policy/policy_export.h"
13 // This file contains utilities shared by both Mac OS X and iOS.
15 namespace base {
16 class Value;
19 namespace policy {
21 // Converts a CFPropertyListRef to the equivalent base::Value. CFDictionary
22 // entries whose key is not a CFStringRef are ignored.
23 // Returns NULL if an invalid CFType was found, such as CFDate or CFData.
24 // NSDictionary is toll-free bridged to CFDictionaryRef, which is a
25 // CFPropertyListRef, so it can also be passed directly here. Same for the
26 // other NS* classes that map to CF* properties.
27 POLICY_EXPORT scoped_ptr<base::Value> PropertyToValue(
28 CFPropertyListRef property);
30 } // namespace policy
32 #endif // COMPONENTS_POLICY_CORE_COMMON_MAC_UTIL_H_