Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6649)

Unified Diff: chrome/browser/policy/cloud/user_cloud_policy_store.cc

Issue 49783006: policy: Remove SigninManager from UserCloudPolicyStore. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased. Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « chrome/browser/policy/cloud/user_cloud_policy_store.h ('k') | chrome/browser/policy/cloud/user_cloud_policy_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698