Chromium Code Reviews| 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 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 696 } | 696 } |
| 697 | 697 |
| 698 // DEPRECATED. | 698 // DEPRECATED. |
| 699 void RetrievePropertyOp::OnKeyOpComplete( | 699 void RetrievePropertyOp::OnKeyOpComplete( |
| 700 const OwnerManager::KeyOpCode return_code, | 700 const OwnerManager::KeyOpCode return_code, |
| 701 const std::vector<uint8>& sig) { | 701 const std::vector<uint8>& sig) { |
| 702 NOTREACHED(); | 702 NOTREACHED(); |
| 703 } | 703 } |
| 704 | 704 |
| 705 std::string RetrievePropertyOp::LookUpInPolicy(const std::string& prop) { | 705 std::string RetrievePropertyOp::LookUpInPolicy(const std::string& prop) { |
| 706 if (prop == kDeviceOwner) { | |
| 707 const em::PolicyData& data = service_->cached_policy(); | |
| 708 if (data.has_username() && !data.has_request_token()) | |
| 709 return service_->cached_policy().username() | |
|
Denis Lagno
2011/04/20 16:24:13
terminating semicolon missing
Chris Masone
2011/04/20 16:41:51
Done.
| |
| 710 } | |
| 706 em::ChromeDeviceSettingsProto pol; | 711 em::ChromeDeviceSettingsProto pol; |
| 707 pol.ParseFromString(service_->cached_policy().policy_value()); | 712 pol.ParseFromString(service_->cached_policy().policy_value()); |
| 708 if (prop == kAccountsPrefAllowNewUser) { | 713 if (prop == kAccountsPrefAllowNewUser) { |
| 709 if (pol.has_allow_new_users() && | 714 if (pol.has_allow_new_users() && |
| 710 pol.allow_new_users().has_allow_new_users() && | 715 pol.allow_new_users().has_allow_new_users() && |
| 711 pol.allow_new_users().allow_new_users()) { | 716 pol.allow_new_users().allow_new_users()) { |
| 712 return kVeritas[1]; // New users allowed, user_whitelist() ignored. | 717 return kVeritas[1]; // New users allowed, user_whitelist() ignored. |
| 713 } | 718 } |
| 714 // If we have the allow_new_users bool, and it is true, we honor that above. | 719 // If we have the allow_new_users bool, and it is true, we honor that above. |
| 715 // In all other cases (don't have it, have it and it is set to false, etc), | 720 // In all other cases (don't have it, have it and it is set to false, etc), |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 920 sig.assign(sig_ptr, sig_ptr + policy_.policy_data_signature().length()); | 925 sig.assign(sig_ptr, sig_ptr + policy_.policy_data_signature().length()); |
| 921 service_->StartVerifyAttempt(policy_.policy_data(), sig, this); | 926 service_->StartVerifyAttempt(policy_.policy_data(), sig, this); |
| 922 } | 927 } |
| 923 | 928 |
| 924 void RetrievePolicyOp::PerformCallback(SignedSettings::ReturnCode code, | 929 void RetrievePolicyOp::PerformCallback(SignedSettings::ReturnCode code, |
| 925 const em::PolicyFetchResponse& value) { | 930 const em::PolicyFetchResponse& value) { |
| 926 d_->OnSettingsOpCompleted(code, value); | 931 d_->OnSettingsOpCompleted(code, value); |
| 927 } | 932 } |
| 928 | 933 |
| 929 } // namespace chromeos | 934 } // namespace chromeos |
| OLD | NEW |