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/policy/device_policy_decoder_chromeos.h" | 5 #include "chrome/browser/policy/device_policy_decoder_chromeos.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 | 406 |
407 if (policy.has_system_timezone()) { | 407 if (policy.has_system_timezone()) { |
408 if (policy.system_timezone().has_timezone()) { | 408 if (policy.system_timezone().has_timezone()) { |
409 policies->Set(key::kSystemTimezone, | 409 policies->Set(key::kSystemTimezone, |
410 POLICY_LEVEL_MANDATORY, | 410 POLICY_LEVEL_MANDATORY, |
411 POLICY_SCOPE_MACHINE, | 411 POLICY_SCOPE_MACHINE, |
412 Value::CreateStringValue( | 412 Value::CreateStringValue( |
413 policy.system_timezone().timezone())); | 413 policy.system_timezone().timezone())); |
414 } | 414 } |
415 } | 415 } |
| 416 |
| 417 if (policy.has_allow_redeem_offers()) { |
| 418 const em::AllowRedeemChromeOsRegistrationOffersProto& container( |
| 419 policy.allow_redeem_offers()); |
| 420 if (container.has_allow_redeem_offers()) { |
| 421 policies->Set(key::kDeviceAllowRedeemChromeOsRegistrationOffers, |
| 422 POLICY_LEVEL_MANDATORY, |
| 423 POLICY_SCOPE_MACHINE, |
| 424 Value::CreateBooleanValue( |
| 425 container.allow_redeem_offers())); |
| 426 } |
| 427 } |
416 } | 428 } |
417 | 429 |
418 } // namespace | 430 } // namespace |
419 | 431 |
420 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy, | 432 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy, |
421 PolicyMap* policies, | 433 PolicyMap* policies, |
422 EnterpriseInstallAttributes* install_attributes) { | 434 EnterpriseInstallAttributes* install_attributes) { |
423 // Decode the various groups of policies. | 435 // Decode the various groups of policies. |
424 DecodeLoginPolicies(policy, policies); | 436 DecodeLoginPolicies(policy, policies); |
425 DecodeKioskPolicies(policy, policies, install_attributes); | 437 DecodeKioskPolicies(policy, policies, install_attributes); |
426 DecodeNetworkPolicies(policy, policies, install_attributes); | 438 DecodeNetworkPolicies(policy, policies, install_attributes); |
427 DecodeReportingPolicies(policy, policies); | 439 DecodeReportingPolicies(policy, policies); |
428 DecodeAutoUpdatePolicies(policy, policies); | 440 DecodeAutoUpdatePolicies(policy, policies); |
429 DecodeGenericPolicies(policy, policies); | 441 DecodeGenericPolicies(policy, policies); |
430 } | 442 } |
431 | 443 |
432 } // namespace policy | 444 } // namespace policy |
OLD | NEW |