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

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

Issue 6974013: Recover policy subsystem correctly after enrollment attempt with a gmail acccount (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/cloud_policy_controller.cc
diff --git a/chrome/browser/policy/cloud_policy_controller.cc b/chrome/browser/policy/cloud_policy_controller.cc
index 25c340e750e01f9b12805907c182bbda48a688b0..ed50b56f3c5b36f1f6e734a736c9581ef2a6b99d 100644
--- a/chrome/browser/policy/cloud_policy_controller.cc
+++ b/chrome/browser/policy/cloud_policy_controller.cc
@@ -167,6 +167,9 @@ void CloudPolicyController::OnDeviceTokenChanged() {
}
void CloudPolicyController::OnCredentialsChanged() {
+ notifier_->Inform(CloudPolicySubsystem::UNENROLLED,
+ CloudPolicySubsystem::NO_DETAILS,
+ PolicyNotifier::POLICY_CONTROLLER);
effective_policy_refresh_error_delay_ms_ = policy_refresh_error_delay_ms_;
SetState(STATE_TOKEN_UNAVAILABLE);
}
@@ -235,10 +238,13 @@ void CloudPolicyController::FetchToken() {
std::string machine_model = identity_strategy_->GetMachineModel();
em::DeviceRegisterRequest_Type policy_type =
identity_strategy_->GetPolicyRegisterType();
- if (identity_strategy_->GetCredentials(&username, &auth_token) &&
- CanBeInManagedDomain(username)) {
- token_fetcher_->FetchToken(auth_token, device_id, policy_type,
- machine_id, machine_model);
+ if (identity_strategy_->GetCredentials(&username, &auth_token)) {
+ if (CanBeInManagedDomain(username)) {
+ token_fetcher_->FetchToken(auth_token, device_id, policy_type,
+ machine_id, machine_model);
+ } else {
+ SetState(STATE_TOKEN_UNMANAGED);
+ }
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698