Remove '_chromeos' from device_policy_decoder_* files

This CL removes '_chromeos' postfix from device_policy_decoder_* , since
the files are under ash/ directory and there isn't similar file name
outside. Also it contains static helpers only.

This CL is part of the Chrome OS source code directory migration:
https://docs.google.com/document/d/1g-98HpzA8XcoGBWUv1gQNr4rbnD5yfvbtYZyPDDbkaE.

Bug: 1164001
Change-Id: If163679d98b0ddad842d0aebcc05aea872fa4b6f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3041037
Commit-Queue: Yeunjoo Choi <ychoi@igalia.com>
Reviewed-by: Maksim Ivanov <emaxx@chromium.org>
Cr-Commit-Position: refs/heads/master@{#905111}
diff --git a/chrome/browser/ash/policy/core/device_cloud_policy_store_ash.cc b/chrome/browser/ash/policy/core/device_cloud_policy_store_ash.cc
index 08eb20c6..92c4121 100644
--- a/chrome/browser/ash/policy/core/device_cloud_policy_store_ash.cc
+++ b/chrome/browser/ash/policy/core/device_cloud_policy_store_ash.cc
@@ -13,7 +13,7 @@
 #include "base/sequence_checker.h"
 #include "base/sequenced_task_runner.h"
 #include "chrome/browser/ash/login/startup_utils.h"
-#include "chrome/browser/ash/policy/core/device_policy_decoder_chromeos.h"
+#include "chrome/browser/ash/policy/core/device_policy_decoder.h"
 #include "chrome/browser/ash/policy/value_validation/onc_device_policy_value_validator.h"
 #include "chromeos/tpm/install_attributes.h"
 #include "components/ownership/owner_key_util.h"
diff --git a/chrome/browser/ash/policy/core/device_policy_decoder_chromeos.cc b/chrome/browser/ash/policy/core/device_policy_decoder.cc
similarity index 99%
rename from chrome/browser/ash/policy/core/device_policy_decoder_chromeos.cc
rename to chrome/browser/ash/policy/core/device_policy_decoder.cc
index 32d61f74..928ef45c 100644
--- a/chrome/browser/ash/policy/core/device_policy_decoder_chromeos.cc
+++ b/chrome/browser/ash/policy/core/device_policy_decoder.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/browser/ash/policy/core/device_policy_decoder_chromeos.h"
+#include "chrome/browser/ash/policy/core/device_policy_decoder.h"
 
 #include <limits>
 #include <memory>
diff --git a/chrome/browser/ash/policy/core/device_policy_decoder_chromeos.h b/chrome/browser/ash/policy/core/device_policy_decoder.h
similarity index 90%
rename from chrome/browser/ash/policy/core/device_policy_decoder_chromeos.h
rename to chrome/browser/ash/policy/core/device_policy_decoder.h
index dd574d8..e92f5ffb2 100644
--- a/chrome/browser/ash/policy/core/device_policy_decoder_chromeos.h
+++ b/chrome/browser/ash/policy/core/device_policy_decoder.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 CHROME_BROWSER_ASH_POLICY_CORE_DEVICE_POLICY_DECODER_CHROMEOS_H_
-#define CHROME_BROWSER_ASH_POLICY_CORE_DEVICE_POLICY_DECODER_CHROMEOS_H_
+#ifndef CHROME_BROWSER_ASH_POLICY_CORE_DEVICE_POLICY_DECODER_H_
+#define CHROME_BROWSER_ASH_POLICY_CORE_DEVICE_POLICY_DECODER_H_
 
 #include <string>
 
@@ -47,4 +47,4 @@
 
 }  // namespace policy
 
-#endif  // CHROME_BROWSER_ASH_POLICY_CORE_DEVICE_POLICY_DECODER_CHROMEOS_H_
+#endif  // CHROME_BROWSER_ASH_POLICY_CORE_DEVICE_POLICY_DECODER_H_
diff --git a/chrome/browser/ash/policy/core/device_policy_decoder_chromeos_unittest.cc b/chrome/browser/ash/policy/core/device_policy_decoder_unittest.cc
similarity index 86%
rename from chrome/browser/ash/policy/core/device_policy_decoder_chromeos_unittest.cc
rename to chrome/browser/ash/policy/core/device_policy_decoder_unittest.cc
index f9db34f..1d7609dc 100644
--- a/chrome/browser/ash/policy/core/device_policy_decoder_chromeos_unittest.cc
+++ b/chrome/browser/ash/policy/core/device_policy_decoder_unittest.cc
@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "chrome/browser/ash/policy/core/device_policy_decoder_chromeos.h"
+#include "chrome/browser/ash/policy/core/device_policy_decoder.h"
 
 #include "base/bind.h"
 #include "base/strings/utf_string_conversions.h"
@@ -55,21 +55,20 @@
 
 }  // namespace
 
-class DevicePolicyDecoderChromeOSTest : public testing::Test {
+class DevicePolicyDecoderTest : public testing::Test {
  public:
-  DevicePolicyDecoderChromeOSTest() = default;
-  ~DevicePolicyDecoderChromeOSTest() override = default;
+  DevicePolicyDecoderTest() = default;
+  ~DevicePolicyDecoderTest() override = default;
 
  protected:
   std::unique_ptr<base::Value> GetWallpaperDict() const;
   std::unique_ptr<base::Value> GetBluetoothServiceAllowedList() const;
 
  private:
-  DISALLOW_COPY_AND_ASSIGN(DevicePolicyDecoderChromeOSTest);
+  DISALLOW_COPY_AND_ASSIGN(DevicePolicyDecoderTest);
 };
 
-std::unique_ptr<base::Value> DevicePolicyDecoderChromeOSTest::GetWallpaperDict()
-    const {
+std::unique_ptr<base::Value> DevicePolicyDecoderTest::GetWallpaperDict() const {
   auto dict = std::make_unique<base::DictionaryValue>();
   dict->SetKey(kWallpaperUrlPropertyName,
                base::Value(kWallpaperUrlPropertyValue));
@@ -79,7 +78,7 @@
 }
 
 std::unique_ptr<base::Value>
-DevicePolicyDecoderChromeOSTest::GetBluetoothServiceAllowedList() const {
+DevicePolicyDecoderTest::GetBluetoothServiceAllowedList() const {
   auto list = std::make_unique<base::ListValue>();
   list->Append(base::Value(kValidBluetoothServiceUUID4));
   list->Append(base::Value(kValidBluetoothServiceUUID8));
@@ -87,8 +86,7 @@
   return list;
 }
 
-TEST_F(DevicePolicyDecoderChromeOSTest,
-       DecodeJsonStringAndNormalizeJSONParseError) {
+TEST_F(DevicePolicyDecoderTest, DecodeJsonStringAndNormalizeJSONParseError) {
   std::string error;
   absl::optional<base::Value> decoded_json = DecodeJsonStringAndNormalize(
       kInvalidJson, key::kDeviceWallpaperImage, &error);
@@ -102,8 +100,7 @@
 }
 
 #if GTEST_HAS_DEATH_TEST
-TEST_F(DevicePolicyDecoderChromeOSTest,
-       DecodeJsonStringAndNormalizeInvalidSchema) {
+TEST_F(DevicePolicyDecoderTest, DecodeJsonStringAndNormalizeInvalidSchema) {
   std::string error;
   EXPECT_DEATH(
       DecodeJsonStringAndNormalize(kWallpaperJson, kInvalidPolicyName, &error),
@@ -111,8 +108,7 @@
 }
 #endif
 
-TEST_F(DevicePolicyDecoderChromeOSTest,
-       DecodeJsonStringAndNormalizeInvalidValue) {
+TEST_F(DevicePolicyDecoderTest, DecodeJsonStringAndNormalizeInvalidValue) {
   std::string error;
   absl::optional<base::Value> decoded_json = DecodeJsonStringAndNormalize(
       kWallpaperJsonInvalidValue, key::kDeviceWallpaperImage, &error);
@@ -125,8 +121,7 @@
       localized_error);
 }
 
-TEST_F(DevicePolicyDecoderChromeOSTest,
-       DecodeJsonStringAndNormalizeUnknownProperty) {
+TEST_F(DevicePolicyDecoderTest, DecodeJsonStringAndNormalizeUnknownProperty) {
   std::string error;
   absl::optional<base::Value> decoded_json = DecodeJsonStringAndNormalize(
       kWallpaperJsonUnknownProperty, key::kDeviceWallpaperImage, &error);
@@ -139,7 +134,7 @@
       localized_error);
 }
 
-TEST_F(DevicePolicyDecoderChromeOSTest, DecodeJsonStringAndNormalizeSuccess) {
+TEST_F(DevicePolicyDecoderTest, DecodeJsonStringAndNormalizeSuccess) {
   std::string error;
   absl::optional<base::Value> decoded_json = DecodeJsonStringAndNormalize(
       kWallpaperJson, key::kDeviceWallpaperImage, &error);
@@ -147,7 +142,7 @@
   EXPECT_TRUE(error.empty());
 }
 
-TEST_F(DevicePolicyDecoderChromeOSTest, UserWhitelistWarning) {
+TEST_F(DevicePolicyDecoderTest, UserWhitelistWarning) {
   PolicyBundle bundle;
   PolicyMap& policies = bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, ""));
 
@@ -176,7 +171,7 @@
           .empty());
 }
 
-TEST_F(DevicePolicyDecoderChromeOSTest, ReportDeviceLoginLogout) {
+TEST_F(DevicePolicyDecoderTest, ReportDeviceLoginLogout) {
   PolicyBundle bundle;
   PolicyMap& policies = bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, ""));
 
@@ -199,7 +194,7 @@
   EXPECT_TRUE(report_device_login_logout_bool);
 }
 
-TEST_F(DevicePolicyDecoderChromeOSTest, ReportDeviceAudioStatus) {
+TEST_F(DevicePolicyDecoderTest, ReportDeviceAudioStatus) {
   PolicyBundle bundle;
   PolicyMap& policies = bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, ""));
 
@@ -222,14 +217,15 @@
   EXPECT_TRUE(report_device_audio_status_bool);
 }
 
-TEST_F(DevicePolicyDecoderChromeOSTest, ReportDeviceNetworkConfiguration) {
+TEST_F(DevicePolicyDecoderTest, ReportDeviceNetworkConfiguration) {
   PolicyBundle bundle;
   PolicyMap& policies = bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, ""));
 
   base::WeakPtr<ExternalDataManager> external_data_manager;
 
   em::ChromeDeviceSettingsProto device_policy;
-  device_policy.mutable_device_reporting()->set_report_network_configuration(true);
+  device_policy.mutable_device_reporting()->set_report_network_configuration(
+      true);
 
   DecodeDevicePolicy(device_policy, external_data_manager, &policies);
 
@@ -245,7 +241,7 @@
   EXPECT_TRUE(report_device_network_configuration_bool);
 }
 
-TEST_F(DevicePolicyDecoderChromeOSTest, ReportDeviceNetworkStatus) {
+TEST_F(DevicePolicyDecoderTest, ReportDeviceNetworkStatus) {
   PolicyBundle bundle;
   PolicyMap& policies = bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, ""));
 
@@ -268,7 +264,7 @@
   EXPECT_TRUE(report_device_network_status_bool);
 }
 
-TEST_F(DevicePolicyDecoderChromeOSTest, kReportDeviceOsUpdateStatus) {
+TEST_F(DevicePolicyDecoderTest, kReportDeviceOsUpdateStatus) {
   PolicyBundle bundle;
   PolicyMap& policies = bundle.Get(PolicyNamespace(POLICY_DOMAIN_CHROME, ""));
 
@@ -291,7 +287,7 @@
   EXPECT_TRUE(report_device_os_update_status_bool);
 }
 
-TEST_F(DevicePolicyDecoderChromeOSTest, DecodeServiceUUIDListSuccess) {
+TEST_F(DevicePolicyDecoderTest, DecodeServiceUUIDListSuccess) {
   std::string error;
   absl::optional<base::Value> decoded_json = DecodeJsonStringAndNormalize(
       kValidBluetoothServiceUUIDList, key::kDeviceAllowedBluetoothServices,
@@ -300,7 +296,7 @@
   EXPECT_TRUE(error.empty());
 }
 
-TEST_F(DevicePolicyDecoderChromeOSTest, DecodeServiceUUIDListError) {
+TEST_F(DevicePolicyDecoderTest, DecodeServiceUUIDListError) {
   std::string error;
   absl::optional<base::Value> decoded_json = DecodeJsonStringAndNormalize(
       kInvalidBluetoothServiceUUIDList, key::kDeviceAllowedBluetoothServices,
@@ -309,4 +305,5 @@
   EXPECT_EQ("Invalid policy value: Invalid value for string (at items[0])",
             error);
 }
+
 }  // namespace policy
diff --git a/chrome/browser/ash/policy/fuzzer/policy_fuzzer.cc b/chrome/browser/ash/policy/fuzzer/policy_fuzzer.cc
index f2e60e7..803229d 100644
--- a/chrome/browser/ash/policy/fuzzer/policy_fuzzer.cc
+++ b/chrome/browser/ash/policy/fuzzer/policy_fuzzer.cc
@@ -16,7 +16,7 @@
 #include "base/test/task_environment.h"
 #include "build/build_config.h"
 #include "chrome/browser/ash/dbus/ash_dbus_helper.h"
-#include "chrome/browser/ash/policy/core/device_policy_decoder_chromeos.h"
+#include "chrome/browser/ash/policy/core/device_policy_decoder.h"
 #include "chrome/browser/ash/policy/fuzzer/policy_fuzzer.pb.h"
 #include "chrome/browser/ash/settings/device_settings_provider.h"
 #include "chrome/browser/ash/settings/device_settings_service.h"
diff --git a/chrome/browser/ash/policy/off_hours/off_hours_proto_parser.h b/chrome/browser/ash/policy/off_hours/off_hours_proto_parser.h
index f269eaa..2e51737 100644
--- a/chrome/browser/ash/policy/off_hours/off_hours_proto_parser.h
+++ b/chrome/browser/ash/policy/off_hours/off_hours_proto_parser.h
@@ -50,7 +50,7 @@
 // { "day_of_week" : int # value is from 1 to 7 (1 = Monday, 2 = Tuesday, etc.)
 //   "time" : int # in milliseconds from the beginning of the day.
 // }
-// This function is used by device_policy_decoder_chromeos to save "OffHours"
+// This function is used by device_policy_decoder.cc to save "OffHours"
 // policy in PolicyMap.
 std::unique_ptr<base::DictionaryValue> ConvertOffHoursProtoToValue(
     const enterprise_management::DeviceOffHoursProto& container);
diff --git a/chrome/browser/ash/settings/device_settings_provider.cc b/chrome/browser/ash/settings/device_settings_provider.cc
index 46e5c8891..09ad755 100644
--- a/chrome/browser/ash/settings/device_settings_provider.cc
+++ b/chrome/browser/ash/settings/device_settings_provider.cc
@@ -24,7 +24,7 @@
 #include "base/threading/thread_restrictions.h"
 #include "base/values.h"
 #include "chrome/browser/ash/ownership/owner_settings_service_ash.h"
-#include "chrome/browser/ash/policy/core/device_policy_decoder_chromeos.h"
+#include "chrome/browser/ash/policy/core/device_policy_decoder.h"
 #include "chrome/browser/ash/policy/handlers/system_proxy_handler.h"
 #include "chrome/browser/ash/policy/off_hours/off_hours_proto_parser.h"
 #include "chrome/browser/ash/settings/cros_settings.h"
@@ -168,11 +168,11 @@
     kVirtualMachinesAllowed,
 };
 
-// Re-use the DecodeJsonStringAndNormalize from device_policy_decoder_chromeos.h
+// Re-use the DecodeJsonStringAndNormalize from device_policy_decoder.h
 // here to decode the json string and validate it against |policy_name|'s
 // schema. If the json string is valid, the decoded base::Value will be stored
 // as |setting_name| in |pref_value_map|. The error can be ignored here since it
-// is already reported during decoding in device_policy_decoder_chromeos.cc.
+// is already reported during decoding in device_policy_decoder.cc.
 void SetJsonDeviceSetting(const std::string& setting_name,
                           const std::string& policy_name,
                           const std::string& json_string,
diff --git a/chrome/browser/chromeos/BUILD.gn b/chrome/browser/chromeos/BUILD.gn
index 8c53d80..3483cb9d 100644
--- a/chrome/browser/chromeos/BUILD.gn
+++ b/chrome/browser/chromeos/BUILD.gn
@@ -1980,8 +1980,8 @@
     "../ash/policy/core/device_local_account_policy_service.h",
     "../ash/policy/core/device_local_account_policy_store.cc",
     "../ash/policy/core/device_local_account_policy_store.h",
-    "../ash/policy/core/device_policy_decoder_chromeos.cc",
-    "../ash/policy/core/device_policy_decoder_chromeos.h",
+    "../ash/policy/core/device_policy_decoder.cc",
+    "../ash/policy/core/device_policy_decoder.h",
     "../ash/policy/core/device_policy_remover.h",
     "../ash/policy/core/dm_token_storage.cc",
     "../ash/policy/core/dm_token_storage.h",
@@ -3963,7 +3963,7 @@
     "../ash/policy/core/device_cloud_policy_manager_chromeos_unittest.cc",
     "../ash/policy/core/device_cloud_policy_store_ash_unittest.cc",
     "../ash/policy/core/device_local_account_policy_service_unittest.cc",
-    "../ash/policy/core/device_policy_decoder_chromeos_unittest.cc",
+    "../ash/policy/core/device_policy_decoder_unittest.cc",
     "../ash/policy/core/dm_token_storage_unittest.cc",
     "../ash/policy/core/user_cloud_policy_manager_chromeos_unittest.cc",
     "../ash/policy/core/user_cloud_policy_store_chromeos_unittest.cc",
diff --git a/components/policy/tools/syntax_check_policy_template_json.py b/components/policy/tools/syntax_check_policy_template_json.py
index fcea325..f2503f84 100755
--- a/components/policy/tools/syntax_check_policy_template_json.py
+++ b/components/policy/tools/syntax_check_policy_template_json.py
@@ -929,7 +929,7 @@
                     ' still have to implement the enrollment-dependent default '
                     'value handling yourself in all places where the device '
                     'policy proto is evaluated. This will probably include '
-                    'device_policy_decoder_chromeos.cc for chrome, but could '
+                    'device_policy_decoder.cc for chrome, but could '
                     'also have to done in other components if they read the '
                     'proto directly. Details: crbug.com/809653')
 
diff --git a/docs/enterprise/add_new_policy.md b/docs/enterprise/add_new_policy.md
index 79c4ceb..144f134 100644
--- a/docs/enterprise/add_new_policy.md
+++ b/docs/enterprise/add_new_policy.md
@@ -117,7 +117,7 @@
             `components/policy/proto/chrome_device_policy.proto`. Please note
             that all proto fields are optional.
         -   Update
-            `chrome/browser/ash/policy/core/device_policy_decoder_chromeos.{h,cc}`
+            `chrome/browser/ash/policy/core/device_policy_decoder.{h,cc}`
             for the new policy.
 7.  Test the policy.
     -   Add a test to verify the policy. You can add a test in