| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/login/signed_settings.h" | 5 #include "chrome/browser/chromeos/login/signed_settings.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 return serialized; | 765 return serialized; |
| 766 | 766 |
| 767 } else if (prop == kReleaseChannel) { | 767 } else if (prop == kReleaseChannel) { |
| 768 if (!pol.has_release_channel() || | 768 if (!pol.has_release_channel() || |
| 769 !pol.release_channel().has_release_channel()) { | 769 !pol.release_channel().has_release_channel()) { |
| 770 return ""; // Default to an invalid channel (will be ignored). | 770 return ""; // Default to an invalid channel (will be ignored). |
| 771 } | 771 } |
| 772 return pol.release_channel().release_channel(); | 772 return pol.release_channel().release_channel(); |
| 773 | 773 |
| 774 } else if (prop == kStatsReportingPref) { | 774 } else if (prop == kStatsReportingPref) { |
| 775 if (pol.has_metrics_enabled()) { | 775 if (!pol.has_metrics_enabled() || |
| 776 return kVeritas[pol.metrics_enabled().metrics_enabled()]; | 776 !pol.metrics_enabled().metrics_enabled()) { |
| 777 return kVeritas[0]; // Default to not collecting metrics. |
| 777 } | 778 } |
| 779 return kVeritas[pol.metrics_enabled().metrics_enabled()]; |
| 780 |
| 778 } | 781 } |
| 779 return std::string(); | 782 return std::string(); |
| 780 } | 783 } |
| 781 | 784 |
| 782 void RetrievePropertyOp::PerformCallback(SignedSettings::ReturnCode code, | 785 void RetrievePropertyOp::PerformCallback(SignedSettings::ReturnCode code, |
| 783 const std::string& value) { | 786 const std::string& value) { |
| 784 d_->OnSettingsOpCompleted(code, value); | 787 d_->OnSettingsOpCompleted(code, value); |
| 785 } | 788 } |
| 786 | 789 |
| 787 StorePolicyOp::StorePolicyOp(em::PolicyFetchResponse* policy, | 790 StorePolicyOp::StorePolicyOp(em::PolicyFetchResponse* policy, |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 955 sig.assign(sig_ptr, sig_ptr + policy_.policy_data_signature().length()); | 958 sig.assign(sig_ptr, sig_ptr + policy_.policy_data_signature().length()); |
| 956 service_->StartVerifyAttempt(policy_.policy_data(), sig, this); | 959 service_->StartVerifyAttempt(policy_.policy_data(), sig, this); |
| 957 } | 960 } |
| 958 | 961 |
| 959 void RetrievePolicyOp::PerformCallback(SignedSettings::ReturnCode code, | 962 void RetrievePolicyOp::PerformCallback(SignedSettings::ReturnCode code, |
| 960 const em::PolicyFetchResponse& value) { | 963 const em::PolicyFetchResponse& value) { |
| 961 d_->OnSettingsOpCompleted(code, value); | 964 d_->OnSettingsOpCompleted(code, value); |
| 962 } | 965 } |
| 963 | 966 |
| 964 } // namespace chromeos | 967 } // namespace chromeos |
| OLD | NEW |