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

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

Issue 12220060: Load policy before signin completes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge with ToT. Created 7 years, 10 months 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/user_cloud_policy_store.cc
diff --git a/chrome/browser/policy/user_cloud_policy_store.cc b/chrome/browser/policy/user_cloud_policy_store.cc
index 6a9b73f8e0884172ebc6629118a9dbd9a72e8498..9a44dc33f4c5b9aae7e8eec859100631d56af02c 100644
--- a/chrome/browser/policy/user_cloud_policy_store.cc
+++ b/chrome/browser/policy/user_cloud_policy_store.cc
@@ -188,7 +188,6 @@ void UserCloudPolicyStore::InstallLoadedPolicyAfterValidation(
DVLOG(1) << "Device ID: " << validator->policy_data()->device_id();
InstallPolicy(validator->policy_data().Pass(), validator->payload().Pass());
- FilterDisallowedPolicies();
status_ = STATUS_OK;
NotifyStoreLoaded();
}
@@ -215,8 +214,9 @@ void UserCloudPolicyStore::Validate(
SigninManager* signin = SigninManagerFactory::GetForProfileIfExists(profile_);
if (signin) {
std::string username = signin->GetAuthenticatedUsername();
- DCHECK(!username.empty());
- validator->ValidateUsername(username);
+ // Validate the username if the user is signed in.
+ if (!username.empty())
+ validator->ValidateUsername(username);
}
if (validate_in_background) {
@@ -247,17 +247,8 @@ void UserCloudPolicyStore::StorePolicyAfterValidation(
base::Bind(&StorePolicyToDiskOnFileThread,
backing_file_path_, *validator->policy()));
InstallPolicy(validator->policy_data().Pass(), validator->payload().Pass());
- FilterDisallowedPolicies();
status_ = STATUS_OK;
NotifyStoreLoaded();
}
-void UserCloudPolicyStore::FilterDisallowedPolicies() {
- // We don't yet allow setting SyncDisabled in desktop cloud policy, because
- // it causes the user to be signed out which then removes the cloud policy.
- // TODO(atwilson): Remove this once we support signing in with sync disabled
- // (http://crbug.com/166148).
- policy_map_.Erase(key::kSyncDisabled);
-}
-
} // namespace policy
« no previous file with comments | « chrome/browser/policy/user_cloud_policy_store.h ('k') | chrome/browser/policy/user_cloud_policy_store_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698