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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 const em::AllowRedeemChromeOsRegistrationOffersProto& container( | 418 const em::AllowRedeemChromeOsRegistrationOffersProto& container( |
419 policy.allow_redeem_offers()); | 419 policy.allow_redeem_offers()); |
420 if (container.has_allow_redeem_offers()) { | 420 if (container.has_allow_redeem_offers()) { |
421 policies->Set(key::kDeviceAllowRedeemChromeOsRegistrationOffers, | 421 policies->Set(key::kDeviceAllowRedeemChromeOsRegistrationOffers, |
422 POLICY_LEVEL_MANDATORY, | 422 POLICY_LEVEL_MANDATORY, |
423 POLICY_SCOPE_MACHINE, | 423 POLICY_SCOPE_MACHINE, |
424 Value::CreateBooleanValue( | 424 Value::CreateBooleanValue( |
425 container.allow_redeem_offers())); | 425 container.allow_redeem_offers())); |
426 } | 426 } |
427 } | 427 } |
428 | |
429 if (policy.has_start_up_flags()) { | |
430 const em::StartUpFlagsProto& container(policy.start_up_flags()); | |
431 if (container.flags_size()) { | |
432 ListValue* flags = new ListValue(); | |
433 RepeatedPtrField<std::string>::const_iterator entry; | |
434 for (entry = container.flags().begin(); | |
435 entry != container.flags().end(); | |
436 ++entry) { | |
437 flags->Append(Value::CreateStringValue(*entry)); | |
438 } | |
439 policies->Set(key::kDeviceStartUpFlags, | |
440 POLICY_LEVEL_MANDATORY, | |
441 POLICY_SCOPE_MACHINE, | |
442 flags); | |
443 } | |
444 } | |
445 } | 428 } |
446 | 429 |
447 } // namespace | 430 } // namespace |
448 | 431 |
449 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy, | 432 void DecodeDevicePolicy(const em::ChromeDeviceSettingsProto& policy, |
450 PolicyMap* policies, | 433 PolicyMap* policies, |
451 EnterpriseInstallAttributes* install_attributes) { | 434 EnterpriseInstallAttributes* install_attributes) { |
452 // Decode the various groups of policies. | 435 // Decode the various groups of policies. |
453 DecodeLoginPolicies(policy, policies); | 436 DecodeLoginPolicies(policy, policies); |
454 DecodeKioskPolicies(policy, policies, install_attributes); | 437 DecodeKioskPolicies(policy, policies, install_attributes); |
455 DecodeNetworkPolicies(policy, policies, install_attributes); | 438 DecodeNetworkPolicies(policy, policies, install_attributes); |
456 DecodeReportingPolicies(policy, policies); | 439 DecodeReportingPolicies(policy, policies); |
457 DecodeAutoUpdatePolicies(policy, policies); | 440 DecodeAutoUpdatePolicies(policy, policies); |
458 DecodeGenericPolicies(policy, policies); | 441 DecodeGenericPolicies(policy, policies); |
459 } | 442 } |
460 | 443 |
461 } // namespace policy | 444 } // namespace policy |
OLD | NEW |