Skip to content

Commit

Permalink
Rename CloudPolicyOverridesMachinePolicy
Browse files Browse the repository at this point in the history
Rename the policy to CloudPolicyOverrides*Platform*Policy.
Also remove Domain joined requirement.

Bug: 939261
Change-Id: Ia74b12c253c21856c73faf57c3cffeab96c9a66c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1509635
Commit-Queue: Owen Min <zmin@chromium.org>
Reviewed-by: Julian Pastarmov <pastarmovj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#639036}
  • Loading branch information
Owen Min authored and Commit Bot committed Mar 8, 2019
1 parent c00532b commit 7a8c7d6
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -791,8 +791,8 @@ const PolicyToPreferenceMapEntry kSimplePolicyMap[] = {
{ key::kPrintPreviewUseSystemDefaultPrinter,
prefs::kPrintPreviewUseSystemDefaultPrinter,
base::Value::Type::BOOLEAN },
{ key::kCloudPolicyOverridesMachinePolicy,
policy_prefs::kCloudPolicyOverridesMachinePolicy,
{ key::kCloudPolicyOverridesPlatformPolicy,
policy_prefs::kCloudPolicyOverridesPlatformPolicy,
base::Value::Type::BOOLEAN },
{ key::kCloudReportingEnabled,
prefs::kCloudReportingEnabled,
Expand Down
4 changes: 2 additions & 2 deletions chrome/test/data/policy/policy_test_cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -3348,9 +3348,9 @@
]
},

"CloudPolicyOverridesMachinePolicy": {
"CloudPolicyOverridesPlatformPolicy": {
"os": ["win", "linux", "mac"],
"test_policy": { "CloudPolicyOverridesMachinePolicy": false },
"test_policy": { "CloudPolicyOverridesPlatformPolicy": false },
"pref_mappings": [
{ "pref": "policy.cloud_override",
"local_state": true
Expand Down
2 changes: 1 addition & 1 deletion components/policy/core/browser/browser_policy_connector.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ void BrowserPolicyConnector::RegisterPrefs(PrefRegistrySimple* registry) {
registry->RegisterBooleanPref(
policy_prefs::kCloudManagementEnrollmentMandatory, false);
registry->RegisterBooleanPref(
policy_prefs::kCloudPolicyOverridesMachinePolicy, false);
policy_prefs::kCloudPolicyOverridesPlatformPolicy, false);
}

} // namespace policy
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ void MachineLevelUserCloudPolicyManager::Connect(
CreateComponentCloudPolicyService(
dm_protocol::kChromeMachineLevelExtensionCloudPolicyType,
policy_dir_.Append(kComponentPolicyCache),
(local_state->GetBoolean(policy_prefs::kCloudPolicyOverridesMachinePolicy)
(local_state->GetBoolean(
policy_prefs::kCloudPolicyOverridesPlatformPolicy)
? POLICY_SOURCE_PRIORITY_CLOUD
: POLICY_SOURCE_CLOUD),
client.get(), schema_registry());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ void UserCloudPolicyManager::Connect(

CreateComponentCloudPolicyService(
dm_protocol::kChromeExtensionPolicyType, component_policy_cache_path_,
(local_state->GetBoolean(policy_prefs::kCloudPolicyOverridesMachinePolicy)
(local_state->GetBoolean(
policy_prefs::kCloudPolicyOverridesPlatformPolicy)
? POLICY_SOURCE_PRIORITY_CLOUD
: POLICY_SOURCE_CLOUD),
client.get(), schema_registry());
Expand Down
1 change: 0 additions & 1 deletion components/policy/core/common/policy_loader_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ const char kBlockedExtensionPrefix[] = "[BLOCKED]";
const char* kInsecurePolicies[] = {
key::kChromeCleanupEnabled,
key::kChromeCleanupReportingEnabled,
key::kCloudPolicyOverridesMachinePolicy,
key::kDefaultSearchProviderEnabled,
key::kHomepageIsNewTabPage,
key::kHomepageLocation,
Expand Down
2 changes: 1 addition & 1 deletion components/policy/core/common/policy_pref_names.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const char kCloudManagementEnrollmentMandatory[] =

// Boolean that specifies whether the cloud policy will override conflicting
// machine policy.
const char kCloudPolicyOverridesMachinePolicy[] = "policy.cloud_override";
const char kCloudPolicyOverridesPlatformPolicy[] = "policy.cloud_override";

} // namespace policy_prefs
} // namespace policy
2 changes: 1 addition & 1 deletion components/policy/core/common/policy_pref_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ POLICY_EXPORT extern const char kUrlBlacklist[];
POLICY_EXPORT extern const char kUrlWhitelist[];
POLICY_EXPORT extern const char kUserPolicyRefreshRate[];
POLICY_EXPORT extern const char kCloudManagementEnrollmentMandatory[];
POLICY_EXPORT extern const char kCloudPolicyOverridesMachinePolicy[];
POLICY_EXPORT extern const char kCloudPolicyOverridesPlatformPolicy[];

} // namespace policy_prefs
} // namespace policy
Expand Down
14 changes: 7 additions & 7 deletions components/policy/resources/policy_templates.json
Original file line number Diff line number Diff line change
Expand Up @@ -12294,25 +12294,25 @@
'desc': '''If "OffHours" policy is set, then the specified device policies are ignored (use the default settings of these policies) during the defined time intervals. Device policies are re-applied by Chrome on every event when "OffHours" period starts or ends. User will be notified and forced to sign out when "OffHours" time end and device policy settings are changed (e.g. when user is logged in not with an allowed account).''',
},
{
'name': 'CloudPolicyOverridesMachinePolicy',
'name': 'CloudPolicyOverridesPlatformPolicy',
'type': 'main',
'schema': { 'type': 'boolean'},
'supported_on': ['chrome.*:62-'],
'supported_on': ['chrome.*:65-'],
'features': {
'dynamic_refresh': False,
'per_profile': False,
},
'example_value': False,
'id': 381,
'caption': '''<ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> cloud policy overrides Machine policy.''',
'caption': '''<ph name="PRODUCT_NAME">$1<ex>Google Chrome</ex></ph> cloud policy overrides Platform policy.''',
'tags': [],
'future': True,
'desc': '''
If the policy is set to true, cloud policy takes precedence if it conflicts with machine policy.
If the policy is set to false or not configured, machine policy takes precedence if it conflicts with cloud policy.
For more details about policy priority, please visit: https://support.google.com/chrome?p=set_chrome_policies_for_devices
If the policy is set to true, cloud policy takes precedence if it conflicts with platform policy.
If the policy is set to false or not configured, platform policy takes precedence if it conflicts with cloud policy.

This policy is available only on Windows instances that are joined to a <ph name="MS_AD_NAME">Microsoft® Active Directory®</ph> domain. or Windows 10 Pro or Enterprise instances that enrolled for device management.''',
This policy is only available as a platform.
''',
},
{
'name': 'PromptForDownloadLocation',
Expand Down

0 comments on commit 7a8c7d6

Please sign in to comment.