Commit f71e60d2 authored by Owen Min's avatar Owen Min Committed by Commit Bot

Remove NTPContentSuggestionsEnabled as default from non android platform.

Remove it before SetEnterpriseDefault being implemented for all platforms
to avoid ugly unknown policy error.

Bug: 640950
Change-Id: I3affe39bc52f5ff003d14ac038be75ac81c25dce
Reviewed-on: https://chromium-review.googlesource.com/1115598Reviewed-by: default avatarJulian Pastarmov <pastarmovj@chromium.org>
Commit-Queue: Owen Min <zmin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571667}
parent dbc3e4a9
...@@ -2,9 +2,10 @@ ...@@ -2,9 +2,10 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#include "chrome/browser/policy/cloud/cloud_policy_test_utils.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.h"
#include "base/values.h" #include "base/values.h"
#include "chrome/browser/policy/cloud/cloud_policy_test_utils.h" #include "build/build_config.h"
#include "components/policy/core/common/policy_map.h" #include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_types.h" #include "components/policy/core/common/policy_types.h"
#include "components/policy/policy_constants.h" #include "components/policy/policy_constants.h"
...@@ -12,10 +13,11 @@ ...@@ -12,10 +13,11 @@
namespace policy { namespace policy {
void GetExpectedDefaultPolicy(PolicyMap* policy_map) { void GetExpectedDefaultPolicy(PolicyMap* policy_map) {
#if defined(OS_ANDROID)
policy_map->Set(key::kNTPContentSuggestionsEnabled, POLICY_LEVEL_MANDATORY, policy_map->Set(key::kNTPContentSuggestionsEnabled, POLICY_LEVEL_MANDATORY,
POLICY_SCOPE_USER, POLICY_SOURCE_ENTERPRISE_DEFAULT, POLICY_SCOPE_USER, POLICY_SOURCE_ENTERPRISE_DEFAULT,
base::WrapUnique(new base::Value(false)), nullptr); base::WrapUnique(new base::Value(false)), nullptr);
#if defined(OS_CHROMEOS) #elif defined(OS_CHROMEOS)
SetEnterpriseUsersDefaults(policy_map); SetEnterpriseUsersDefaults(policy_map);
#endif #endif
} }
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/bind_helpers.h" #include "base/bind_helpers.h"
#include "base/sequenced_task_runner.h" #include "base/sequenced_task_runner.h"
#include "build/build_config.h"
#include "components/account_id/account_id.h" #include "components/account_id/account_id.h"
#include "components/crash/core/common/crash_key.h" #include "components/crash/core/common/crash_key.h"
#include "components/policy/core/common/cloud/cloud_external_data_manager.h" #include "components/policy/core/common/cloud/cloud_external_data_manager.h"
...@@ -121,6 +122,7 @@ void UserCloudPolicyManager::GetChromePolicy(PolicyMap* policy_map) { ...@@ -121,6 +122,7 @@ void UserCloudPolicyManager::GetChromePolicy(PolicyMap* policy_map) {
// given that this is an enterprise user. // given that this is an enterprise user.
// TODO(treib,atwilson): We should just call SetEnterpriseUsersDefaults here, // TODO(treib,atwilson): We should just call SetEnterpriseUsersDefaults here,
// see crbug.com/640950. // see crbug.com/640950.
#if defined(OS_ANDROID)
if (store()->has_policy() && if (store()->has_policy() &&
!policy_map->Get(key::kNTPContentSuggestionsEnabled)) { !policy_map->Get(key::kNTPContentSuggestionsEnabled)) {
policy_map->Set(key::kNTPContentSuggestionsEnabled, POLICY_LEVEL_MANDATORY, policy_map->Set(key::kNTPContentSuggestionsEnabled, POLICY_LEVEL_MANDATORY,
...@@ -128,6 +130,7 @@ void UserCloudPolicyManager::GetChromePolicy(PolicyMap* policy_map) { ...@@ -128,6 +130,7 @@ void UserCloudPolicyManager::GetChromePolicy(PolicyMap* policy_map) {
std::make_unique<base::Value>(false), std::make_unique<base::Value>(false),
nullptr /* external_data_fetcher */); nullptr /* external_data_fetcher */);
} }
#endif
} }
} // namespace policy } // namespace policy
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment