summaryrefslogtreecommitdiff
path: root/chromium/components/policy/core/common/legacy_chrome_policy_migrator.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2022-06-22 09:53:13 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2022-06-22 10:23:17 +0000
commitc5dbcb143405a38088d78b4b760d64aaff5157ab (patch)
treeb37edca540b35f898e212bebfa6ded0806988122 /chromium/components/policy/core/common/legacy_chrome_policy_migrator.h
parent774f54339e5db91f785733232d3950366db65d07 (diff)
downloadqtwebengine-chromium-c5dbcb143405a38088d78b4b760d64aaff5157ab.tar.gz
BASELINE: Update Chromium to 102.0.5005.137
Change-Id: I162cdc7f56760218868e000a4c8ea92573344036 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/policy/core/common/legacy_chrome_policy_migrator.h')
-rw-r--r--chromium/components/policy/core/common/legacy_chrome_policy_migrator.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/chromium/components/policy/core/common/legacy_chrome_policy_migrator.h b/chromium/components/policy/core/common/legacy_chrome_policy_migrator.h
new file mode 100644
index 00000000000..0012b6463ec
--- /dev/null
+++ b/chromium/components/policy/core/common/legacy_chrome_policy_migrator.h
@@ -0,0 +1,40 @@
+// 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_