| Index: chrome/browser/policy/cloud/user_cloud_policy_store.cc
|
| diff --git a/chrome/browser/policy/cloud/user_cloud_policy_store.cc b/chrome/browser/policy/cloud/user_cloud_policy_store.cc
|
| index cda8fb7f1c57b500da256413d8725a38faebb1a0..43f4e868d61c7f8e15a9b4ba8a99a91bb5030d08 100644
|
| --- a/chrome/browser/policy/cloud/user_cloud_policy_store.cc
|
| +++ b/chrome/browser/policy/cloud/user_cloud_policy_store.cc
|
| @@ -114,6 +114,10 @@ scoped_ptr<UserCloudPolicyStore> UserCloudPolicyStore::Create(
|
| new UserCloudPolicyStore(profile, path, background_task_runner));
|
| }
|
|
|
| +void UserCloudPolicyStore::SetSigninUsername(const std::string& username) {
|
| + signin_username_ = username;
|
| +}
|
| +
|
| void UserCloudPolicyStore::LoadImmediately() {
|
| DVLOG(1) << "Initiating immediate policy load from disk";
|
| // Cancel any pending Load/Store/Validate operations.
|
| @@ -217,17 +221,10 @@ void UserCloudPolicyStore::Validate(
|
| scoped_ptr<UserCloudPolicyValidator> validator = CreateValidator(
|
| policy.Pass(),
|
| CloudPolicyValidatorBase::TIMESTAMP_NOT_BEFORE);
|
| - SigninManager* signin = SigninManagerFactory::GetForProfileIfExists(profile_);
|
| - if (signin) {
|
| - std::string username = signin->GetAuthenticatedUsername();
|
| - if (username.empty())
|
| - username = signin->GetUsernameForAuthInProgress();
|
| -
|
| - // Validate the username if the user is signed in (or in the process of
|
| - // signing in).
|
| - if (!username.empty())
|
| - validator->ValidateUsername(username);
|
| - }
|
| +
|
| + // Validate the username if the user is signed in.
|
| + if (!signin_username_.empty())
|
| + validator->ValidateUsername(signin_username_);
|
|
|
| if (validate_in_background) {
|
| // Start validation in the background. The Validator will free itself once
|
|
|