summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorjoaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-17 08:58:35 +0000
committerjoaodasilva@chromium.org <joaodasilva@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-17 08:58:35 +0000
commit10e0513470f5a0b78284350f3b2fa1f8ef675f48 (patch)
treefbb96634cbbc7f8f6748979d340f18eefd55d431 /components
parent6308d0f4328ac4108e9fae8e481e6796829e76e5 (diff)
downloadchromium_src-10e0513470f5a0b78284350f3b2fa1f8ef675f48.zip
chromium_src-10e0513470f5a0b78284350f3b2fa1f8ef675f48.tar.gz
chromium_src-10e0513470f5a0b78284350f3b2fa1f8ef675f48.tar.bz2
Added a policy_switches.cc file in the policy component.
Moved the policy-specific switches into this file, and refactored the policy code to include the new file instead of chrome_switches.cc. This removes one more dependency on //chrome code from the policy code. BUG=271392 R=bauerb@chromium.org, dconnelly@chromium.org, jochen@chromium.org Review URL: https://codereview.chromium.org/26972003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@229084 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
-rw-r--r--components/OWNERS1
-rw-r--r--components/policy.gypi2
-rw-r--r--components/policy/core/common/policy_pref_names.h6
-rw-r--r--components/policy/core/common/policy_switches.cc32
-rw-r--r--components/policy/core/common/policy_switches.h26
5 files changed, 64 insertions, 3 deletions
diff --git a/components/OWNERS b/components/OWNERS
index ea47228..3f578f2 100644
--- a/components/OWNERS
+++ b/components/OWNERS
@@ -41,6 +41,7 @@ per-file policy.gypi=joaodasilva@chromium.org
per-file policy.gypi=bartfab@chromium.org
per-file policy.gypi=atwilson@chromium.org
per-file policy.gypi=pneubeck@chromium.org
+per-file policy.gypi=dconnelly@chromium.org
per-file sessions.gypi=marja@chromium.org
per-file sessions.gypi=sky@chromium.org
diff --git a/components/policy.gypi b/components/policy.gypi
index 8dd3bb1..77fe110 100644
--- a/components/policy.gypi
+++ b/components/policy.gypi
@@ -22,6 +22,8 @@
'sources': [
'policy/core/common/policy_pref_names.cc',
'policy/core/common/policy_pref_names.h',
+ 'policy/core/common/policy_switches.cc',
+ 'policy/core/common/policy_switches.h',
'policy/core/common/schema.cc',
'policy/core/common/schema.h',
'policy/core/common/schema_internal.h',
diff --git a/components/policy/core/common/policy_pref_names.h b/components/policy/core/common/policy_pref_names.h
index 0a65262..7e83c06 100644
--- a/components/policy/core/common/policy_pref_names.h
+++ b/components/policy/core/common/policy_pref_names.h
@@ -2,8 +2,8 @@
// 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_PREF_NAMES_H_
-#define COMPONENTS_POLICY_CORE_COMMON_PREF_NAMES_H_
+#ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_PREF_NAMES_H_
+#define COMPONENTS_POLICY_CORE_COMMON_POLICY_PREF_NAMES_H_
#include "components/policy/policy_export.h"
@@ -18,4 +18,4 @@ POLICY_EXPORT extern const char kLastPolicyStatisticsUpdate[];
} // prefs
} // namespace policy
-#endif // COMPONENTS_POLICY_CORE_COMMON_PREF_NAMES_H_
+#endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_PREF_NAMES_H_
diff --git a/components/policy/core/common/policy_switches.cc b/components/policy/core/common/policy_switches.cc
new file mode 100644
index 0000000..343bdef
--- /dev/null
+++ b/components/policy/core/common/policy_switches.cc
@@ -0,0 +1,32 @@
+// 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.
+
+#include "components/policy/core/common/policy_switches.h"
+
+namespace policy {
+namespace switches {
+
+// The maximum amount of delay in ms between receiving a cloud policy
+// invalidation and fetching the policy. A random delay up to this value is used
+// to prevent Chrome clients from overwhelming the cloud policy server when a
+// policy which affects many users is changed.
+const char kCloudPolicyInvalidationDelay[] = "cloud-policy-invalidation-delay";
+
+// If present, disables the loading and application of cloud policy for
+// signed-in users.
+const char kDisableCloudPolicyOnSignin[] = "disable-cloud-policy-on-signin";
+
+// Disables pushing cloud policy to Chrome using an invalidation service.
+const char kDisableCloudPolicyPush[] = "disable-cloud-policy-push";
+
+#if defined(OS_ANDROID) || defined(OS_IOS)
+// Registers for cloud policy using the BROWSER client type instead of the
+// ANDROID_BROWSER or IOS_BROWSER types.
+// This allows skipping the server whitelist.
+// TODO(joaodasilva): remove this. http://crbug.com/248527
+const char kFakeCloudPolicyType[] = "fake-cloud-policy-type";
+#endif // defined(OS_ANDROID) || defined(OS_IOS)
+
+} // namespace switches
+} // namespace policy
diff --git a/components/policy/core/common/policy_switches.h b/components/policy/core/common/policy_switches.h
new file mode 100644
index 0000000..039b7d5
--- /dev/null
+++ b/components/policy/core/common/policy_switches.h
@@ -0,0 +1,26 @@
+// 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_POLICY_SWITCHES_H_
+#define COMPONENTS_POLICY_CORE_COMMON_POLICY_SWITCHES_H_
+
+#include "components/policy/policy_export.h"
+
+#include "build/build_config.h"
+
+namespace policy {
+namespace switches {
+
+POLICY_EXPORT extern const char kCloudPolicyInvalidationDelay[];
+POLICY_EXPORT extern const char kDisableCloudPolicyOnSignin[];
+POLICY_EXPORT extern const char kDisableCloudPolicyPush[];
+
+#if defined(OS_ANDROID) || defined(OS_IOS)
+POLICY_EXPORT extern const char kFakeCloudPolicyType[];
+#endif // defined(OS_ANDROID) || defined(OS_IOS)
+
+} // namespace switches
+} // namespace policy
+
+#endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_SWITCHES_H_