| 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/bind.h" | 10 #include "base/bind.h" |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 } else if (prop == kAccountsPrefUsers) { | 365 } else if (prop == kAccountsPrefUsers) { |
| 366 em::UserWhitelistProto* whitelist_proto = pol.mutable_user_whitelist(); | 366 em::UserWhitelistProto* whitelist_proto = pol.mutable_user_whitelist(); |
| 367 whitelist_proto->clear_user_whitelist(); | 367 whitelist_proto->clear_user_whitelist(); |
| 368 const base::ListValue& users = static_cast<const base::ListValue&>(value); | 368 const base::ListValue& users = static_cast<const base::ListValue&>(value); |
| 369 for (base::ListValue::const_iterator i = users.begin(); | 369 for (base::ListValue::const_iterator i = users.begin(); |
| 370 i != users.end(); ++i) { | 370 i != users.end(); ++i) { |
| 371 std::string email; | 371 std::string email; |
| 372 if ((*i)->GetAsString(&email)) | 372 if ((*i)->GetAsString(&email)) |
| 373 whitelist_proto->add_user_whitelist(email.c_str()); | 373 whitelist_proto->add_user_whitelist(email.c_str()); |
| 374 } | 374 } |
| 375 } else if (prop == kDeviceOwner) { |
| 376 // We don't serialize this one to the policy blob. |
| 375 } else { | 377 } else { |
| 376 NOTREACHED(); | 378 NOTREACHED(); |
| 377 } | 379 } |
| 378 poldata->set_policy_value(pol.SerializeAsString()); | 380 poldata->set_policy_value(pol.SerializeAsString()); |
| 379 } | 381 } |
| 380 | 382 |
| 381 void StorePropertyOp::PerformCallback(SignedSettings::ReturnCode code, | 383 void StorePropertyOp::PerformCallback(SignedSettings::ReturnCode code, |
| 382 bool value) { | 384 bool value) { |
| 383 d_->OnSettingsOpCompleted(code, value); | 385 d_->OnSettingsOpCompleted(code, value); |
| 384 } | 386 } |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 sig.assign(sig_ptr, sig_ptr + policy_.policy_data_signature().length()); | 691 sig.assign(sig_ptr, sig_ptr + policy_.policy_data_signature().length()); |
| 690 service_->StartVerifyAttempt(policy_.policy_data(), sig, this); | 692 service_->StartVerifyAttempt(policy_.policy_data(), sig, this); |
| 691 } | 693 } |
| 692 | 694 |
| 693 void RetrievePolicyOp::PerformCallback(SignedSettings::ReturnCode code, | 695 void RetrievePolicyOp::PerformCallback(SignedSettings::ReturnCode code, |
| 694 const em::PolicyFetchResponse& value) { | 696 const em::PolicyFetchResponse& value) { |
| 695 d_->OnSettingsOpCompleted(code, value); | 697 d_->OnSettingsOpCompleted(code, value); |
| 696 } | 698 } |
| 697 | 699 |
| 698 } // namespace chromeos | 700 } // namespace chromeos |
| OLD | NEW |