Chromium Code Reviews| 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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 376 std::unique_ptr<base::ListValue> input_methods(new base::ListValue); | 376 std::unique_ptr<base::ListValue> input_methods(new base::ListValue); |
| 377 const em::LoginScreenInputMethodsProto& login_screen_input_methods( | 377 const em::LoginScreenInputMethodsProto& login_screen_input_methods( |
| 378 policy.login_screen_input_methods()); | 378 policy.login_screen_input_methods()); |
| 379 for (const auto& input_method : | 379 for (const auto& input_method : |
| 380 login_screen_input_methods.login_screen_input_methods()) | 380 login_screen_input_methods.login_screen_input_methods()) |
| 381 input_methods->AppendString(input_method); | 381 input_methods->AppendString(input_method); |
| 382 policies->Set(key::kDeviceLoginScreenInputMethods, POLICY_LEVEL_MANDATORY, | 382 policies->Set(key::kDeviceLoginScreenInputMethods, POLICY_LEVEL_MANDATORY, |
| 383 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, | 383 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, |
| 384 std::move(input_methods), nullptr); | 384 std::move(input_methods), nullptr); |
| 385 } | 385 } |
| 386 | |
| 387 if (policy.has_device_ecryptfs_migration_strategy()) { | |
| 388 const em::DeviceEcryptfsMigrationStrategyProto& container( | |
| 389 policy.device_ecryptfs_migration_strategy()); | |
| 390 if (container.has_migration_strategy()) { | |
| 391 policies->Set( | |
| 392 key::kDeviceEcryptfsMigrationStrategy, POLICY_LEVEL_MANDATORY, | |
| 393 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, | |
| 394 DecodeIntegerValue(container.migration_strategy()), nullptr); | |
| 395 } | |
|
hidehiko
2017/06/01 16:07:16
What value should be set if has_migration_strategy
| |
| 396 } else { | |
| 397 // Missing value means the migration is not allowed. | |
| 398 policies->Set(key::kDeviceEcryptfsMigrationStrategy, POLICY_LEVEL_MANDATORY, | |
| 399 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, | |
| 400 DecodeIntegerValue( | |
| 401 enterprise_management:: | |
| 402 DeviceEcryptfsMigrationStrategyProto::DISALLOW_ARC), | |
| 403 nullptr); | |
| 404 } | |
| 386 } | 405 } |
| 387 | 406 |
| 388 void DecodeNetworkPolicies(const em::ChromeDeviceSettingsProto& policy, | 407 void DecodeNetworkPolicies(const em::ChromeDeviceSettingsProto& policy, |
| 389 PolicyMap* policies) { | 408 PolicyMap* policies) { |
| 390 if (policy.has_data_roaming_enabled()) { | 409 if (policy.has_data_roaming_enabled()) { |
| 391 const em::DataRoamingEnabledProto& container(policy.data_roaming_enabled()); | 410 const em::DataRoamingEnabledProto& container(policy.data_roaming_enabled()); |
| 392 if (container.has_data_roaming_enabled()) { | 411 if (container.has_data_roaming_enabled()) { |
| 393 policies->Set( | 412 policies->Set( |
| 394 key::kDeviceDataRoamingEnabled, POLICY_LEVEL_MANDATORY, | 413 key::kDeviceDataRoamingEnabled, POLICY_LEVEL_MANDATORY, |
| 395 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, | 414 POLICY_SCOPE_MACHINE, POLICY_SOURCE_CLOUD, |
| (...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 876 // Decode the various groups of policies. | 895 // Decode the various groups of policies. |
| 877 DecodeLoginPolicies(policy, policies); | 896 DecodeLoginPolicies(policy, policies); |
| 878 DecodeNetworkPolicies(policy, policies); | 897 DecodeNetworkPolicies(policy, policies); |
| 879 DecodeReportingPolicies(policy, policies); | 898 DecodeReportingPolicies(policy, policies); |
| 880 DecodeAutoUpdatePolicies(policy, policies); | 899 DecodeAutoUpdatePolicies(policy, policies); |
| 881 DecodeAccessibilityPolicies(policy, policies); | 900 DecodeAccessibilityPolicies(policy, policies); |
| 882 DecodeGenericPolicies(policy, policies); | 901 DecodeGenericPolicies(policy, policies); |
| 883 } | 902 } |
| 884 | 903 |
| 885 } // namespace policy | 904 } // namespace policy |
| OLD | NEW |