summaryrefslogtreecommitdiffstats
path: root/components/policy/core/common/preferences_mac.h
diff options
context:
space:
mode:
Diffstat (limited to 'components/policy/core/common/preferences_mac.h')
-rw-r--r--components/policy/core/common/preferences_mac.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/components/policy/core/common/preferences_mac.h b/components/policy/core/common/preferences_mac.h
new file mode 100644
index 0000000..5bb14c0
--- /dev/null
+++ b/components/policy/core/common/preferences_mac.h
@@ -0,0 +1,35 @@
+// Copyright 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_POLICY_CORE_COMMON_PREFERENCES_MAC_H_
+#define COMPONENTS_POLICY_CORE_COMMON_PREFERENCES_MAC_H_
+
+#include <CoreFoundation/CoreFoundation.h>
+
+#include "base/basictypes.h"
+#include "components/policy/policy_export.h"
+
+// Wraps a small part of the CFPreferences API surface in a very thin layer, to
+// allow it to be mocked out for testing.
+
+// See CFPreferences documentation for function documentation, as these call
+// through directly to their CFPreferences equivalents (Foo ->
+// CFPreferencesFoo).
+class POLICY_EXPORT MacPreferences {
+ public:
+ MacPreferences() {}
+ virtual ~MacPreferences() {}
+
+ virtual Boolean AppSynchronize(CFStringRef applicationID);
+
+ virtual CFPropertyListRef CopyAppValue(CFStringRef key,
+ CFStringRef applicationID);
+
+ virtual Boolean AppValueIsForced(CFStringRef key, CFStringRef applicationID);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(MacPreferences);
+};
+
+#endif // COMPONENTS_POLICY_CORE_COMMON_PREFERENCES_MAC_H_