OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/policy/device_policy_decoder_chromeos.h" | 5 #include "chrome/browser/chromeos/policy/device_policy_decoder_chromeos.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 822 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 const em::DeviceQuirksDownloadEnabledProto& container( | 833 const em::DeviceQuirksDownloadEnabledProto& container( |
834 policy.quirks_download_enabled()); | 834 policy.quirks_download_enabled()); |
835 if (container.has_quirks_download_enabled()) { | 835 if (container.has_quirks_download_enabled()) { |
836 policies->Set(key::kDeviceQuirksDownloadEnabled, POLICY_LEVEL_MANDATORY, | 836 policies->Set(key::kDeviceQuirksDownloadEnabled, POLICY_LEVEL_MANDATORY, |
837 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, | 837 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, |
838 base::MakeUnique<base::FundamentalValue>( | 838 base::MakeUnique<base::FundamentalValue>( |
839 container.quirks_download_enabled()), | 839 container.quirks_download_enabled()), |
840 nullptr); | 840 nullptr); |
841 } | 841 } |
842 } | 842 } |
| 843 |
| 844 if (policy.has_device_wallpaper_image()) { |
| 845 const em::DeviceWallpaperImageProto& container( |
| 846 policy.device_wallpaper_image()); |
| 847 if (container.has_device_wallpaper_image()) { |
| 848 std::unique_ptr<base::DictionaryValue> dict_val = |
| 849 base::DictionaryValue::From( |
| 850 base::JSONReader::Read(container.device_wallpaper_image())); |
| 851 policies->Set(key::kDeviceWallpaperImage, POLICY_LEVEL_MANDATORY, |
| 852 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, |
| 853 std::move(dict_val), nullptr); |
| 854 } |
| 855 } |
843 } | 856 } |
844 | 857 |
845 } // namespace | 858 } // namespace |
846 | 859 |
847 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy, | 860 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy, |
848 PolicyMap* policies) { | 861 PolicyMap* policies) { |
849 // Decode the various groups of policies. | 862 // Decode the various groups of policies. |
850 DecodeLoginPolicies(policy, policies); | 863 DecodeLoginPolicies(policy, policies); |
851 DecodeNetworkPolicies(policy, policies); | 864 DecodeNetworkPolicies(policy, policies); |
852 DecodeReportingPolicies(policy, policies); | 865 DecodeReportingPolicies(policy, policies); |
853 DecodeAutoUpdatePolicies(policy, policies); | 866 DecodeAutoUpdatePolicies(policy, policies); |
854 DecodeAccessibilityPolicies(policy, policies); | 867 DecodeAccessibilityPolicies(policy, policies); |
855 DecodeGenericPolicies(policy, policies); | 868 DecodeGenericPolicies(policy, policies); |
856 } | 869 } |
857 | 870 |
858 } // namespace policy | 871 } // namespace policy |
OLD | NEW |