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 864 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
875 } | 875 } |
876 if (entry->has_product_id()) { | 876 if (entry->has_product_id()) { |
877 ids->SetString("pid", base::StringPrintf("%04X", entry->product_id())); | 877 ids->SetString("pid", base::StringPrintf("%04X", entry->product_id())); |
878 } | 878 } |
879 whitelist->Append(ids); | 879 whitelist->Append(ids); |
880 } | 880 } |
881 policies->Set(key::kUsbDetachableWhitelist, POLICY_LEVEL_MANDATORY, | 881 policies->Set(key::kUsbDetachableWhitelist, POLICY_LEVEL_MANDATORY, |
882 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, whitelist, | 882 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, whitelist, |
883 nullptr); | 883 nullptr); |
884 } | 884 } |
885 | |
886 if (policy.has_system_timezone_automatic_detection() && | |
887 policy.system_timezone_automatic_detection() | |
888 .has_timezone_detection_type()) { | |
889 policies->Set( | |
890 key::kSystemTimezoneAutomaticDetection, POLICY_LEVEL_MANDATORY, | |
891 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, | |
892 new base::FundamentalValue(policy.system_timezone_automatic_detection() | |
cschuet (SLOW)
2016/03/30 13:08:48
Use DecodeIntegerValue() which performs range chec
Alexander Alekseev
2016/03/31 06:51:49
Done.
| |
893 .timezone_detection_type()), | |
894 nullptr); | |
895 } | |
885 } | 896 } |
886 | 897 |
887 } // namespace | 898 } // namespace |
888 | 899 |
889 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy, | 900 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy, |
890 PolicyMap* policies) { | 901 PolicyMap* policies) { |
891 // Decode the various groups of policies. | 902 // Decode the various groups of policies. |
892 DecodeLoginPolicies(policy, policies); | 903 DecodeLoginPolicies(policy, policies); |
893 DecodeNetworkPolicies(policy, policies); | 904 DecodeNetworkPolicies(policy, policies); |
894 DecodeReportingPolicies(policy, policies); | 905 DecodeReportingPolicies(policy, policies); |
895 DecodeAutoUpdatePolicies(policy, policies); | 906 DecodeAutoUpdatePolicies(policy, policies); |
896 DecodeAccessibilityPolicies(policy, policies); | 907 DecodeAccessibilityPolicies(policy, policies); |
897 DecodeGenericPolicies(policy, policies); | 908 DecodeGenericPolicies(policy, policies); |
898 } | 909 } |
899 | 910 |
900 } // namespace policy | 911 } // namespace policy |
OLD | NEW |