Commit af28a55e authored by Brian Malcolm's avatar Brian Malcolm Committed by Commit Bot

Add LegacyChromePolicyMigrator for migrating non-pref policies

This is needed to handle GPO policies that do not have a corresponding pref.
Without this, logic to handle both policies simultaneously would involve
lots of refactoring of the components that listen for policy changes.

BUG=chromium:1105185

Change-Id: I8e30522941fb9623614882e098891238e26eeaaf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2295754Reviewed-by: default avatarJungshik Shin <jshin@chromium.org>
Reviewed-by: default avatarNicolas Ouellet-Payeur <nicolaso@chromium.org>
Reviewed-by: default avatarOwen Min <zmin@chromium.org>
Commit-Queue: Brian Malcolm <bmalcolm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#789634}
parent 030e694e
......@@ -62,7 +62,7 @@ void BrowserSwitcherPolicyMigrator::Migrate(policy::PolicyBundle* bundle) {
}
extension_map.Set("browser_switcher_enabled", entry->DeepCopy());
using Migration = policy::ExtensionPolicyMigrator::Migration;
using Migration = policy::PolicyMigrator::Migration;
const Migration migrations[] = {
Migration("alternative_browser_path",
policy::key::kAlternativeBrowserPath),
......
......@@ -5,10 +5,8 @@
#include "chrome/browser/policy/chrome_extension_policy_migrator.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "components/strings/grit/components_strings.h"
#include "extensions/common/hashed_extension_id.h"
#include "ui/base/l10n/l10n_util.h"
namespace policy {
......@@ -46,29 +44,7 @@ void ChromeExtensionPolicyMigrator::CopyPoliciesIfUnset(
PolicyDomain::POLICY_DOMAIN_CHROME, /* component_id */ std::string()));
for (const auto& migration : migrations) {
PolicyMap::Entry* entry = extension_map->GetMutable(migration.old_name);
if (entry) {
if (!chrome_map.Get(migration.new_name)) {
VLOG(3) << "Extension policy is configured: '" << migration.old_name
<< "'. Copied to '" << migration.new_name << "'.";
auto new_entry = entry->DeepCopy();
migration.transform.Run(new_entry.value());
new_entry.AddError(
l10n_util::GetStringFUTF8(IDS_POLICY_MIGRATED_NEW_POLICY,
base::UTF8ToUTF16(migration.old_name)));
chrome_map.Set(migration.new_name, std::move(new_entry));
} else {
VLOG(3) << "Extension policy is configured, but conflicts: '"
<< migration.old_name << "' (Chrome policy '"
<< migration.new_name << "' is also set). Skipped.";
}
entry->AddError(
l10n_util::GetStringFUTF8(IDS_POLICY_MIGRATED_OLD_POLICY,
base::UTF8ToUTF16(migration.new_name)));
} else {
VLOG(3) << "Extension policy is not configured: '" << migration.old_name
<< "'. Skipped.";
}
CopyPolicyIfUnset(*extension_map, &chrome_map, migration);
}
}
......
......@@ -5,12 +5,16 @@
#ifndef CHROME_BROWSER_POLICY_CHROME_EXTENSION_POLICY_MIGRATOR_H_
#define CHROME_BROWSER_POLICY_CHROME_EXTENSION_POLICY_MIGRATOR_H_
#include "components/policy/core/common/extension_policy_migrator.h"
#include "components/policy/core/common/policy_migrator.h"
namespace policy {
// ExtensionPolicyMigrator with chrome-specific helper functions.
class ChromeExtensionPolicyMigrator : public ExtensionPolicyMigrator {
// A helper class that migrates a deprecated policy to a new policy across
// domain boundaries, by setting up the new policy based on the old one. It can
// migrate a deprecated extension policy to a new Chrome policy.
//
// PolicyMigrator with chrome-specific helper functions.
class ChromeExtensionPolicyMigrator : public PolicyMigrator {
public:
~ChromeExtensionPolicyMigrator() override {}
......
......@@ -51,7 +51,7 @@ void SetPolicy(PolicyMap* policy,
class TestingPolicyMigrator : public ChromeExtensionPolicyMigrator {
public:
void Migrate(PolicyBundle* bundle) override {
using Migration = ExtensionPolicyMigrator::Migration;
using Migration = PolicyMigrator::Migration;
const Migration migrations[] = {
Migration(kOldPolicy1, kNewPolicy1),
Migration(kOldPolicy2, kNewPolicy2),
......
......@@ -213,7 +213,7 @@ void ProfilePolicyConnector::Init(
}
#endif
std::vector<std::unique_ptr<ExtensionPolicyMigrator>> migrators;
std::vector<std::unique_ptr<PolicyMigrator>> migrators;
#if defined(OS_WIN)
migrators.push_back(
std::make_unique<browser_switcher::BrowserSwitcherPolicyMigrator>());
......@@ -344,7 +344,7 @@ ConfigurationPolicyProvider* ProfilePolicyConnector::GetPlatformProvider(
std::unique_ptr<PolicyService>
ProfilePolicyConnector::CreatePolicyServiceWithInitializationThrottled(
const std::vector<ConfigurationPolicyProvider*>& policy_providers,
std::vector<std::unique_ptr<ExtensionPolicyMigrator>> migrators,
std::vector<std::unique_ptr<PolicyMigrator>> migrators,
ConfigurationPolicyProvider* user_policy_delegate) {
DCHECK(user_policy_delegate);
......
......@@ -26,7 +26,7 @@ class ProxiedPoliciesPropagatedWatcher;
class CloudPolicyStore;
class ConfigurationPolicyProvider;
class ExtensionPolicyMigrator;
class PolicyMigrator;
class PolicyService;
class PolicyServiceImpl;
class SchemaRegistry;
......@@ -114,7 +114,7 @@ class ProfilePolicyConnector final {
// [2] i.e. g_browser_process->local_state()
std::unique_ptr<PolicyService> CreatePolicyServiceWithInitializationThrottled(
const std::vector<ConfigurationPolicyProvider*>& policy_providers,
std::vector<std::unique_ptr<ExtensionPolicyMigrator>> migrators,
std::vector<std::unique_ptr<PolicyMigrator>> migrators,
ConfigurationPolicyProvider* user_policy_delegate);
// Called when primary user policies that are proxied to the device-wide
......
......@@ -97,8 +97,6 @@ jumbo_source_set("internal") {
"config_dir_policy_loader.h",
"configuration_policy_provider.cc",
"configuration_policy_provider.h",
"extension_policy_migrator.cc",
"extension_policy_migrator.h",
"external_data_fetcher.cc",
"external_data_fetcher.h",
"external_data_manager.h",
......@@ -106,6 +104,8 @@ jumbo_source_set("internal") {
"features.h",
"json_schema_constants.cc",
"json_schema_constants.h",
"legacy_chrome_policy_migrator.cc",
"legacy_chrome_policy_migrator.h",
"management/management_service.cc",
"management/management_service.h",
"management/platform_management_service.cc",
......@@ -123,6 +123,8 @@ jumbo_source_set("internal") {
"policy_map.h",
"policy_merger.cc",
"policy_merger.h",
"policy_migrator.cc",
"policy_migrator.h",
"policy_namespace.cc",
"policy_namespace.h",
"policy_proto_decoders.cc",
......@@ -178,6 +180,7 @@ jumbo_source_set("internal") {
"//services/network/public/cpp",
"//third_party/libxml:xml_writer",
"//third_party/re2",
"//ui/base",
"//url",
]
......@@ -389,6 +392,7 @@ source_set("unit_tests") {
"cloud/device_management_service_unittest.cc",
"cloud/user_info_fetcher_unittest.cc",
"generate_policy_source_unittest.cc",
"legacy_chrome_policy_migrator_unittest.cc",
"management/management_service_unittest.cc",
"plist_writer_unittest.cc",
"policy_bundle_unittest.cc",
......@@ -483,6 +487,7 @@ source_set("unit_tests") {
"//testing/gmock",
"//testing/gtest",
"//third_party/libxml:xml_reader",
"//ui/base",
]
if (is_chromeos) {
deps += [ "//chromeos/system" ]
......
......@@ -8,4 +8,5 @@ include_rules = [
"+net/traffic_annotation",
"+services/network/test",
"+third_party/libxml/chromium",
"+ui/base/l10n",
]
......@@ -13,11 +13,11 @@
#include "base/task/thread_pool.h"
#include "base/values.h"
#include "components/policy/core/common/configuration_policy_provider.h"
#include "components/policy/core/common/extension_policy_migrator.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/policy_bundle.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_migrator.h"
#include "components/policy/core/common/policy_namespace.h"
#include "components/policy/core/common/policy_types.h"
#include "testing/gmock/include/gmock/gmock.h"
......
// Copyright 2019 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/extension_policy_migrator.h"
#include <algorithm>
#include <utility>
#include "base/bind.h"
namespace policy {
namespace {
void DoNothing(base::Value* val) {}
} // namespace
ExtensionPolicyMigrator::Migration::Migration(Migration&&) = default;
ExtensionPolicyMigrator::Migration::Migration(const char* old_name_,
const char* new_name_)
: Migration(old_name_, new_name_, base::BindRepeating(&DoNothing)) {}
ExtensionPolicyMigrator::Migration::Migration(const char* old_name_,
const char* new_name_,
ValueTransform transform_)
: old_name(old_name_),
new_name(new_name_),
transform(std::move(transform_)) {}
ExtensionPolicyMigrator::Migration::~Migration() = default;
} // namespace policy
// Copyright 2020 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/legacy_chrome_policy_migrator.h"
#include <string>
#include "components/policy/core/common/policy_bundle.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/core/common/policy_namespace.h"
namespace policy {
LegacyChromePolicyMigrator::LegacyChromePolicyMigrator(const char* old_name,
const char* new_name)
: migration_(old_name, new_name) {}
LegacyChromePolicyMigrator::LegacyChromePolicyMigrator(
const char* old_name,
const char* new_name,
Migration::ValueTransform transform)
: migration_(old_name, new_name, transform) {}
LegacyChromePolicyMigrator::~LegacyChromePolicyMigrator() = default;
void LegacyChromePolicyMigrator::Migrate(policy::PolicyBundle* bundle) {
policy::PolicyMap& chrome_map =
bundle->Get(policy::PolicyNamespace(policy::POLICY_DOMAIN_CHROME, ""));
CopyPolicyIfUnset(chrome_map, &chrome_map, migration_);
}
} // namespace policy
// Copyright 2020 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_LEGACY_CHROME_POLICY_MIGRATOR_H_
#define COMPONENTS_POLICY_CORE_COMMON_LEGACY_CHROME_POLICY_MIGRATOR_H_
#include "components/policy/core/common/policy_migrator.h"
namespace policy {
// LegacyChromePolicyMigrator migrates a deprecated Chrome domain policy to a
// new name, setting up the new policy based on the old one.
//
// This is intended to be used for policies that do not have a corresponding
// pref. If the policy has a pref, please use
// |LegacyPoliciesDeprecatingPolicyHandler| instead.
class POLICY_EXPORT LegacyChromePolicyMigrator : public PolicyMigrator {
public:
using Migration = PolicyMigrator::Migration;
LegacyChromePolicyMigrator(const char* old_name, const char* new_name);
LegacyChromePolicyMigrator(const char* old_name,
const char* new_name,
Migration::ValueTransform transform);
~LegacyChromePolicyMigrator() override;
LegacyChromePolicyMigrator(const LegacyChromePolicyMigrator&) = delete;
LegacyChromePolicyMigrator& operator=(const LegacyChromePolicyMigrator&) =
delete;
void Migrate(policy::PolicyBundle* bundle) override;
private:
Migration migration_;
};
} // namespace policy
#endif // COMPONENTS_POLICY_CORE_COMMON_LEGACY_CHROME_POLICY_MIGRATOR_H_
// Copyright 2020 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/legacy_chrome_policy_migrator.h"
#include "base/bind.h"
#include "base/callback.h"
#include "base/strings/string16.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
namespace policy {
namespace {
const char kOldPolicy[] = "OldPolicy";
const char kNewPolicy[] = "NewPolicy";
const char kOtherPolicy[] = "OtherPolicy";
const int kOldValue = 111;
const int kNewValue = 222;
const int kTransformedValue = 333;
const int kOtherValue = 999;
void MultiplyByThree(base::Value* val) {
*val = base::Value(val->GetInt() * 3);
}
void SetPolicy(PolicyMap* policy,
const char* policy_name,
std::unique_ptr<base::Value> value) {
policy->Set(policy_name, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
POLICY_SOURCE_CLOUD, std::move(value), nullptr);
}
} // namespace
TEST(LegacyChromePolicyMigratorTest, CopyPolicyIfUnset) {
PolicyBundle bundle;
PolicyMap& chrome_map = bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, ""));
SetPolicy(&chrome_map, kOldPolicy, std::make_unique<base::Value>(kOldValue));
SetPolicy(&chrome_map, kOtherPolicy,
std::make_unique<base::Value>(kOtherValue));
LegacyChromePolicyMigrator migrator(kOldPolicy, kNewPolicy);
migrator.Migrate(&bundle);
// kOldPolicy should have been copied to kNewPolicy, kOtherPolicy remains
EXPECT_EQ(3u, chrome_map.size());
ASSERT_TRUE(chrome_map.GetValue(kNewPolicy));
// Old Value should be copied over.
EXPECT_EQ(base::Value(kOldValue), *chrome_map.GetValue(kNewPolicy));
// Other Value should be unchanged.
EXPECT_EQ(base::Value(kOtherValue), *chrome_map.GetValue(kOtherPolicy));
base::RepeatingCallback<base::string16(int)> l10nlookup =
base::BindRepeating(&l10n_util::GetStringUTF16);
// Old policy should always be marked deprecated
EXPECT_FALSE(
chrome_map.Get(kOldPolicy)->GetLocalizedErrors(l10nlookup).empty());
EXPECT_FALSE(
chrome_map.Get(kNewPolicy)->GetLocalizedErrors(l10nlookup).empty());
}
TEST(LegacyChromePolicyMigratorTest, TransformPolicy) {
PolicyBundle bundle;
PolicyMap& chrome_map = bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, ""));
SetPolicy(&chrome_map, kOldPolicy, std::make_unique<base::Value>(kOldValue));
LegacyChromePolicyMigrator migrator(kOldPolicy, kNewPolicy,
base::BindRepeating(&MultiplyByThree));
migrator.Migrate(&bundle);
ASSERT_TRUE(chrome_map.GetValue(kNewPolicy));
// Old Value should be transformed
EXPECT_EQ(base::Value(kTransformedValue), *chrome_map.GetValue(kNewPolicy));
}
TEST(LegacyChromePolicyMigratorTest, IgnoreOldIfNewIsSet) {
PolicyBundle bundle;
PolicyMap& chrome_map = bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, ""));
SetPolicy(&chrome_map, kOldPolicy, std::make_unique<base::Value>(kOldValue));
SetPolicy(&chrome_map, kNewPolicy, std::make_unique<base::Value>(kNewValue));
LegacyChromePolicyMigrator migrator(kOldPolicy, kNewPolicy);
migrator.Migrate(&bundle);
// New Value is unchanged
EXPECT_EQ(base::Value(kNewValue), *chrome_map.GetValue(kNewPolicy));
// Should be no warning on new policy
base::RepeatingCallback<base::string16(int)> l10nlookup =
base::BindRepeating(&l10n_util::GetStringUTF16);
// Old policy should always be marked deprecated
EXPECT_FALSE(
chrome_map.Get(kOldPolicy)->GetLocalizedErrors(l10nlookup).empty());
// No warnings on new policy because it was unchanged.
EXPECT_TRUE(
chrome_map.Get(kNewPolicy)->GetLocalizedErrors(l10nlookup).empty());
}
} // namespace policy
// Copyright 2020 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_migrator.h"
#include <algorithm>
#include <utility>
#include "base/bind.h"
#include "base/logging.h"
#include "base/strings/utf_string_conversions.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
namespace policy {
namespace {
void DoNothing(base::Value* val) {}
} // namespace
PolicyMigrator::~PolicyMigrator() = default;
void PolicyMigrator::CopyPolicyIfUnset(PolicyMap& source,
PolicyMap* dest,
const Migration& migration) {
PolicyMap::Entry* entry = source.GetMutable(migration.old_name);
if (entry) {
if (!dest->Get(migration.new_name)) {
VLOG(3) << "Legacy policy '" << migration.old_name
<< "' has been copied to '" << migration.new_name << "'.";
auto new_entry = entry->DeepCopy();
migration.transform.Run(new_entry.value());
new_entry.AddError(
l10n_util::GetStringFUTF8(IDS_POLICY_MIGRATED_NEW_POLICY,
base::UTF8ToUTF16(migration.old_name)));
dest->Set(migration.new_name, std::move(new_entry));
} else {
VLOG(3) << "Legacy policy '" << migration.old_name
<< "' is ignored because '" << migration.new_name
<< "' is also set. ";
}
entry->AddError(l10n_util::GetStringFUTF8(
IDS_POLICY_MIGRATED_OLD_POLICY, base::UTF8ToUTF16(migration.new_name)));
} else {
VLOG(3) << "Legacy policy '" << migration.old_name << "' is not set.";
}
}
PolicyMigrator::Migration::Migration(Migration&&) = default;
PolicyMigrator::Migration::Migration(const char* old_name, const char* new_name)
: Migration(old_name, new_name, base::BindRepeating(&DoNothing)) {}
PolicyMigrator::Migration::Migration(const char* old_name,
const char* new_name,
ValueTransform transform)
: old_name(old_name), new_name(new_name), transform(std::move(transform)) {}
PolicyMigrator::Migration::~Migration() = default;
} // namespace policy
// Copyright 2018 The Chromium Authors. All rights reserved.
// Copyright 2020 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_EXTENSION_POLICY_MIGRATOR_H_
#define COMPONENTS_POLICY_CORE_COMMON_EXTENSION_POLICY_MIGRATOR_H_
#ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_MIGRATOR_H_
#define COMPONENTS_POLICY_CORE_COMMON_POLICY_MIGRATOR_H_
#include <memory>
......@@ -11,47 +11,53 @@
#include "base/containers/span.h"
#include "base/values.h"
#include "components/policy/core/common/policy_bundle.h"
#include "components/policy/core/common/policy_map.h"
#include "components/policy/policy_export.h"
namespace policy {
// A helper class that migrates a deprecated policy to a new policy across
// domain boundaries, by setting up the new policy based on the old one. It can
// migrate a deprecated extension policy to a new Chrome policy.
// A helper class that migrates a deprecated policy to a new policy -
// potentially across domain boundaries, by setting up the new policy based on
// the old one. It can migrate a deprecated policy to a new policy.
//
// For migrations that are only in the Chrome domain: you should use
// |LegacyPoliciesDeprecatingPolicyHandler| instead.
class POLICY_EXPORT ExtensionPolicyMigrator {
// For migrations that are only in the Chrome domain and which are accessed via
// prefs: you should use |LegacyPoliciesDeprecatingPolicyHandler| instead.
class POLICY_EXPORT PolicyMigrator {
public:
virtual ~ExtensionPolicyMigrator() {}
virtual ~PolicyMigrator();
// If there are deprecated policies in |bundle|, set the value of the new
// policies accordingly.
virtual void Migrate(PolicyBundle* bundle) = 0;
// Indicates how to rename a policy when migrating from the extension domain
// to the Chrome domain.
// Indicates how to rename a policy when migrating the old policy to the new
// policy.
struct POLICY_EXPORT Migration {
using ValueTransform = base::RepeatingCallback<void(base::Value*)>;
Migration(Migration&&);
Migration(const char* old_name_, const char* new_name_);
Migration(const char* old_name_,
const char* new_name_,
ValueTransform transform_);
Migration(const char* old_name, const char* new_name);
Migration(const char* old_name,
const char* new_name,
ValueTransform transform);
~Migration();
// Old name for the policy, in the extension domain.
// Old name for the policy
const char* old_name;
// New name for the policy, in the Chrome domain.
const char* new_name;
// Function to use to convert values from the old namespace to the new
// namespace (e.g. convert value types). It should mutate the Value in
// Function to use to convert values from the old policy to the new
// policy (e.g. convert value types). It should mutate the Value in
// place. By default, it does no transform.
ValueTransform transform;
};
protected:
static void CopyPolicyIfUnset(PolicyMap& source,
PolicyMap* dest,
const Migration& migration);
};
} // namespace policy
#endif // COMPONENTS_POLICY_CORE_COMMON_EXTENSION_POLICY_MIGRATOR_H_
#endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_MIGRATOR_H_
......@@ -17,8 +17,8 @@
#include "base/observer_list.h"
#include "base/threading/thread_checker.h"
#include "components/policy/core/common/configuration_policy_provider.h"
#include "components/policy/core/common/extension_policy_migrator.h"
#include "components/policy/core/common/policy_bundle.h"
#include "components/policy/core/common/policy_migrator.h"
#include "components/policy/core/common/policy_service.h"
#include "components/policy/policy_export.h"
......@@ -31,14 +31,13 @@ class POLICY_EXPORT PolicyServiceImpl
public ConfigurationPolicyProvider::Observer {
public:
using Providers = std::vector<ConfigurationPolicyProvider*>;
using Migrators = std::vector<std::unique_ptr<ExtensionPolicyMigrator>>;
using Migrators = std::vector<std::unique_ptr<PolicyMigrator>>;
// Creates a new PolicyServiceImpl with the list of
// ConfigurationPolicyProviders, in order of decreasing priority.
explicit PolicyServiceImpl(
Providers providers,
Migrators migrators =
std::vector<std::unique_ptr<ExtensionPolicyMigrator>>());
Migrators migrators = std::vector<std::unique_ptr<PolicyMigrator>>());
// Creates a new PolicyServiceImpl with the list of
// ConfigurationPolicyProviders, in order of decreasing priority.
......@@ -47,8 +46,7 @@ class POLICY_EXPORT PolicyServiceImpl
// |UnthrottleInitialization| has been called.
static std::unique_ptr<PolicyServiceImpl> CreateWithThrottledInitialization(
Providers providers,
Migrators migrators =
std::vector<std::unique_ptr<ExtensionPolicyMigrator>>());
Migrators migrators = std::vector<std::unique_ptr<PolicyMigrator>>());
~PolicyServiceImpl() override;
......
......@@ -14,10 +14,10 @@
#include "base/run_loop.h"
#include "base/test/task_environment.h"
#include "base/values.h"
#include "components/policy/core/common/extension_policy_migrator.h"
#include "components/policy/core/common/external_data_fetcher.h"
#include "components/policy/core/common/mock_configuration_policy_provider.h"
#include "components/policy/core/common/mock_policy_service.h"
#include "components/policy/core/common/policy_migrator.h"
#include "components/policy/core/common/policy_types.h"
#include "components/policy/policy_constants.h"
#include "components/strings/grit/components_strings.h"
......@@ -96,7 +96,7 @@ class ChangePolicyObserver : public PolicyService::Observer {
bool observer_invoked_;
};
class MockPolicyMigrator : public ExtensionPolicyMigrator {
class MockPolicyMigrator : public PolicyMigrator {
public:
MOCK_METHOD1(Migrate, void(PolicyBundle* bundle));
};
......
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