summaryrefslogtreecommitdiffstats
path: root/components/policy
diff options
context:
space:
mode:
authordconnelly@chromium.org <dconnelly@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-27 13:34:05 +0000
committerdconnelly@chromium.org <dconnelly@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-27 13:34:05 +0000
commite6c76577a69a6f4be1d3438fa9a04e202ed649ba (patch)
treeb0d26a0a14f893768ade7aef3171d507636c5e13 /components/policy
parente4b33452e599d61c2cedfac2167fcb5f9e91dd29 (diff)
downloadchromium_src-e6c76577a69a6f4be1d3438fa9a04e202ed649ba.zip
chromium_src-e6c76577a69a6f4be1d3438fa9a04e202ed649ba.tar.gz
chromium_src-e6c76577a69a6f4be1d3438fa9a04e202ed649ba.tar.bz2
Revert of https://codereview.chromium.org/78603003/
Reason for revert: broke win again :/ TBR=jochen@chromium.org NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/91103004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237562 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/policy')
-rw-r--r--components/policy/core/common/preferences_mac.cc19
-rw-r--r--components/policy/core/common/preferences_mac.h35
-rw-r--r--components/policy/core/common/preferences_mock_mac.cc47
-rw-r--r--components/policy/core/common/preferences_mock_mac.h34
-rw-r--r--components/policy/stub_to_remove.cc6
5 files changed, 0 insertions, 141 deletions
diff --git a/components/policy/core/common/preferences_mac.cc b/components/policy/core/common/preferences_mac.cc
deleted file mode 100644
index 9d4833f..0000000
--- a/components/policy/core/common/preferences_mac.cc
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright (c) 2010 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.
-
-#include "components/policy/core/common/preferences_mac.h"
-
-Boolean MacPreferences::AppSynchronize(CFStringRef applicationID) {
- return CFPreferencesAppSynchronize(applicationID);
-}
-
-CFPropertyListRef MacPreferences::CopyAppValue(CFStringRef key,
- CFStringRef applicationID) {
- return CFPreferencesCopyAppValue(key, applicationID);
-}
-
-Boolean MacPreferences::AppValueIsForced(CFStringRef key,
- CFStringRef applicationID) {
- return CFPreferencesAppValueIsForced(key, applicationID);
-}
diff --git a/components/policy/core/common/preferences_mac.h b/components/policy/core/common/preferences_mac.h
deleted file mode 100644
index 71acc53..0000000
--- a/components/policy/core/common/preferences_mac.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright (c) 2010 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_
diff --git a/components/policy/core/common/preferences_mock_mac.cc b/components/policy/core/common/preferences_mock_mac.cc
deleted file mode 100644
index 585095b..0000000
--- a/components/policy/core/common/preferences_mock_mac.cc
+++ /dev/null
@@ -1,47 +0,0 @@
-// Copyright (c) 2010 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.
-
-#include "components/policy/core/common/preferences_mock_mac.h"
-
-MockPreferences::MockPreferences() {
- values_.reset(CFDictionaryCreateMutable(kCFAllocatorDefault,
- 0,
- &kCFTypeDictionaryKeyCallBacks,
- &kCFTypeDictionaryValueCallBacks));
- forced_.reset(CFSetCreateMutable(kCFAllocatorDefault,
- 0,
- &kCFTypeSetCallBacks));
-}
-
-MockPreferences::~MockPreferences() {
-}
-
-Boolean MockPreferences::AppSynchronize(CFStringRef applicationID) {
- return true;
-}
-
-CFPropertyListRef MockPreferences::CopyAppValue(CFStringRef key,
- CFStringRef applicationID) {
- CFPropertyListRef value;
- Boolean found = CFDictionaryGetValueIfPresent(values_,
- key,
- &value);
- if (!found || !value)
- return NULL;
- CFRetain(value);
- return value;
-}
-
-Boolean MockPreferences::AppValueIsForced(CFStringRef key,
- CFStringRef applicationID) {
- return CFSetContainsValue(forced_, key);
-}
-
-void MockPreferences::AddTestItem(CFStringRef key,
- CFPropertyListRef value,
- bool is_forced) {
- CFDictionarySetValue(values_, key, value);
- if (is_forced)
- CFSetAddValue(forced_, key);
-}
diff --git a/components/policy/core/common/preferences_mock_mac.h b/components/policy/core/common/preferences_mock_mac.h
deleted file mode 100644
index d752f6c..0000000
--- a/components/policy/core/common/preferences_mock_mac.h
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2011 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_MOCK_MAC_H_
-#define COMPONENTS_POLICY_CORE_COMMON_PREFERENCES_MOCK_MAC_H_
-
-#include "base/mac/scoped_cftyperef.h"
-#include "components/policy/core/common/preferences_mac.h"
-#include "components/policy/policy_export.h"
-
-// Mock preferences wrapper for testing code that interacts with CFPreferences.
-class POLICY_EXPORT MockPreferences : public MacPreferences {
- public:
- MockPreferences();
- virtual ~MockPreferences();
-
- virtual Boolean AppSynchronize(CFStringRef applicationID) OVERRIDE;
-
- virtual CFPropertyListRef CopyAppValue(CFStringRef key,
- CFStringRef applicationID) OVERRIDE;
-
- virtual Boolean AppValueIsForced(CFStringRef key,
- CFStringRef applicationID) OVERRIDE;
-
- // Adds a preference item with the given info to the test set.
- void AddTestItem(CFStringRef key, CFPropertyListRef value, bool is_forced);
-
- private:
- base::ScopedCFTypeRef<CFMutableDictionaryRef> values_;
- base::ScopedCFTypeRef<CFMutableSetRef> forced_;
-};
-
-#endif // COMPONENTS_POLICY_CORE_COMMON_PREFERENCES_MOCK_MAC_H_
diff --git a/components/policy/stub_to_remove.cc b/components/policy/stub_to_remove.cc
deleted file mode 100644
index 8ae5154..0000000
--- a/components/policy/stub_to_remove.cc
+++ /dev/null
@@ -1,6 +0,0 @@
-// 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.
-
-// TODO(dconnelly): remove this file and update the comment on policy.gypi.
-// http://crbug.com/271392.