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 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 if (policy.has_metrics_enabled()) { | 510 if (policy.has_metrics_enabled()) { |
511 const em::MetricsEnabledProto& container(policy.metrics_enabled()); | 511 const em::MetricsEnabledProto& container(policy.metrics_enabled()); |
512 if (container.has_metrics_enabled()) { | 512 if (container.has_metrics_enabled()) { |
513 policies->Set(key::kDeviceMetricsReportingEnabled, | 513 policies->Set(key::kDeviceMetricsReportingEnabled, |
514 POLICY_LEVEL_MANDATORY, | 514 POLICY_LEVEL_MANDATORY, |
515 POLICY_SCOPE_MACHINE, | 515 POLICY_SCOPE_MACHINE, |
516 Value::CreateBooleanValue(container.metrics_enabled())); | 516 Value::CreateBooleanValue(container.metrics_enabled())); |
517 } | 517 } |
518 } | 518 } |
519 | 519 |
520 if (policy.has_release_channel() && | 520 if (policy.has_release_channel()) { |
521 policy.release_channel().has_release_channel()) { | 521 const em::ReleaseChannelProto& container(policy.release_channel()); |
522 std::string channel(policy.release_channel().release_channel()); | 522 if (container.has_release_channel()) { |
523 policies->Set(key::kChromeOsReleaseChannel, | 523 std::string channel(container.release_channel()); |
524 POLICY_LEVEL_MANDATORY, | 524 policies->Set(key::kChromeOsReleaseChannel, |
525 POLICY_SCOPE_MACHINE, | 525 POLICY_LEVEL_MANDATORY, |
526 Value::CreateStringValue(channel)); | 526 POLICY_SCOPE_MACHINE, |
527 // TODO(dubroy): Once http://crosbug.com/17015 is implemented, we won't | 527 Value::CreateStringValue(channel)); |
528 // have to pass the channel in here, only ping the update engine to tell | 528 // TODO(dubroy): Once http://crosbug.com/17015 is implemented, we won't |
529 // it to fetch the channel from the policy. | 529 // have to pass the channel in here, only ping the update engine to tell |
530 chromeos::DBusThreadManager::Get()->GetUpdateEngineClient()-> | 530 // it to fetch the channel from the policy. |
531 SetReleaseTrack(channel); | 531 chromeos::DBusThreadManager::Get()->GetUpdateEngineClient()-> |
| 532 SetReleaseTrack(channel); |
| 533 } |
| 534 if (container.has_release_channel_delegated()) { |
| 535 policies->Set(key::kChromeOsReleaseChannelDelegated, |
| 536 POLICY_LEVEL_MANDATORY, |
| 537 POLICY_SCOPE_MACHINE, |
| 538 Value::CreateBooleanValue( |
| 539 container.release_channel_delegated())); |
| 540 } |
532 } | 541 } |
533 } | 542 } |
534 | 543 |
535 // static | 544 // static |
536 void DevicePolicyCache::DecodeDevicePolicy( | 545 void DevicePolicyCache::DecodeDevicePolicy( |
537 const em::ChromeDeviceSettingsProto& policy, | 546 const em::ChromeDeviceSettingsProto& policy, |
538 PolicyMap* policies) { | 547 PolicyMap* policies) { |
539 // Decode the various groups of policies. | 548 // Decode the various groups of policies. |
540 DecodeLoginPolicies(policy, policies); | 549 DecodeLoginPolicies(policy, policies); |
541 DecodeKioskPolicies(policy, policies); | 550 DecodeKioskPolicies(policy, policies); |
542 DecodeNetworkPolicies(policy, policies); | 551 DecodeNetworkPolicies(policy, policies); |
543 DecodeReportingPolicies(policy, policies); | 552 DecodeReportingPolicies(policy, policies); |
544 DecodeGenericPolicies(policy, policies); | 553 DecodeGenericPolicies(policy, policies); |
545 } | 554 } |
546 | 555 |
547 } // namespace policy | 556 } // namespace policy |
OLD | NEW |