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_cache.h" | 5 #include "chrome/browser/policy/device_policy_cache.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 POLICY_SCOPE_MACHINE, | 517 POLICY_SCOPE_MACHINE, |
518 Value::CreateBooleanValue( | 518 Value::CreateBooleanValue( |
519 container.report_activity_times())); | 519 container.report_activity_times())); |
520 } | 520 } |
521 if (container.has_report_boot_mode()) { | 521 if (container.has_report_boot_mode()) { |
522 policies->Set(key::kReportDeviceBootMode, | 522 policies->Set(key::kReportDeviceBootMode, |
523 POLICY_LEVEL_MANDATORY, | 523 POLICY_LEVEL_MANDATORY, |
524 POLICY_SCOPE_MACHINE, | 524 POLICY_SCOPE_MACHINE, |
525 Value::CreateBooleanValue(container.report_boot_mode())); | 525 Value::CreateBooleanValue(container.report_boot_mode())); |
526 } | 526 } |
| 527 if (container.has_report_location()) { |
| 528 policies->Set(key::kReportDeviceLocation, |
| 529 POLICY_LEVEL_MANDATORY, |
| 530 POLICY_SCOPE_MACHINE, |
| 531 Value::CreateBooleanValue(container.report_location())); |
| 532 } |
527 } | 533 } |
528 } | 534 } |
529 | 535 |
530 // static | 536 // static |
531 void DevicePolicyCache::DecodeGenericPolicies( | 537 void DevicePolicyCache::DecodeGenericPolicies( |
532 const em::ChromeDeviceSettingsProto& policy, | 538 const em::ChromeDeviceSettingsProto& policy, |
533 PolicyMap* policies) { | 539 PolicyMap* policies) { |
534 if (policy.has_device_policy_refresh_rate()) { | 540 if (policy.has_device_policy_refresh_rate()) { |
535 const em::DevicePolicyRefreshRateProto& container( | 541 const em::DevicePolicyRefreshRateProto& container( |
536 policy.device_policy_refresh_rate()); | 542 policy.device_policy_refresh_rate()); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 } | 582 } |
577 | 583 |
578 if (policy.has_auto_update_settings()) { | 584 if (policy.has_auto_update_settings()) { |
579 const em::AutoUpdateSettingsProto& container(policy.auto_update_settings()); | 585 const em::AutoUpdateSettingsProto& container(policy.auto_update_settings()); |
580 if (container.has_update_disabled()) { | 586 if (container.has_update_disabled()) { |
581 policies->Set(key::kDeviceAutoUpdateDisabled, | 587 policies->Set(key::kDeviceAutoUpdateDisabled, |
582 POLICY_LEVEL_MANDATORY, | 588 POLICY_LEVEL_MANDATORY, |
583 POLICY_SCOPE_MACHINE, | 589 POLICY_SCOPE_MACHINE, |
584 Value::CreateBooleanValue(container.update_disabled())); | 590 Value::CreateBooleanValue(container.update_disabled())); |
585 } | 591 } |
| 592 |
| 593 if (container.has_target_version_prefix()) { |
| 594 policies->Set(key::kDeviceTargetVersionPrefix, |
| 595 POLICY_LEVEL_MANDATORY, |
| 596 POLICY_SCOPE_MACHINE, |
| 597 Value::CreateStringValue( |
| 598 container.target_version_prefix())); |
| 599 } |
586 } | 600 } |
587 | 601 |
588 if (policy.has_start_up_urls()) { | 602 if (policy.has_start_up_urls()) { |
589 const em::StartUpUrlsProto& container(policy.start_up_urls()); | 603 const em::StartUpUrlsProto& container(policy.start_up_urls()); |
590 if (container.start_up_urls_size()) { | 604 if (container.start_up_urls_size()) { |
591 ListValue* urls = new ListValue(); | 605 ListValue* urls = new ListValue(); |
592 RepeatedPtrField<std::string>::const_iterator entry; | 606 RepeatedPtrField<std::string>::const_iterator entry; |
593 for (entry = container.start_up_urls().begin(); | 607 for (entry = container.start_up_urls().begin(); |
594 entry != container.start_up_urls().end(); | 608 entry != container.start_up_urls().end(); |
595 ++entry) { | 609 ++entry) { |
(...skipping 13 matching lines...) Expand all Loading... |
609 PolicyMap* policies) { | 623 PolicyMap* policies) { |
610 // Decode the various groups of policies. | 624 // Decode the various groups of policies. |
611 DecodeLoginPolicies(policy, policies); | 625 DecodeLoginPolicies(policy, policies); |
612 DecodeKioskPolicies(policy, policies); | 626 DecodeKioskPolicies(policy, policies); |
613 DecodeNetworkPolicies(policy, policies); | 627 DecodeNetworkPolicies(policy, policies); |
614 DecodeReportingPolicies(policy, policies); | 628 DecodeReportingPolicies(policy, policies); |
615 DecodeGenericPolicies(policy, policies); | 629 DecodeGenericPolicies(policy, policies); |
616 } | 630 } |
617 | 631 |
618 } // namespace policy | 632 } // namespace policy |
OLD | NEW |