OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/policy/cloud/user_policy_signin_service.h" | 5 #include "chrome/browser/policy/cloud/user_policy_signin_service.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
526 // come from a policy fetch. | 526 // come from a policy fetch. |
527 if (client->status() == | 527 if (client->status() == |
528 policy::DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED) { | 528 policy::DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED) { |
529 // OK, policy fetch failed with MANAGEMENT_NOT_SUPPORTED - this is our | 529 // OK, policy fetch failed with MANAGEMENT_NOT_SUPPORTED - this is our |
530 // trigger to revert to "unmanaged" mode (we will check for management | 530 // trigger to revert to "unmanaged" mode (we will check for management |
531 // being re-enabled on the next restart and/or login). | 531 // being re-enabled on the next restart and/or login). |
532 DVLOG(1) << "DMServer returned NOT_SUPPORTED error - removing policy"; | 532 DVLOG(1) << "DMServer returned NOT_SUPPORTED error - removing policy"; |
533 | 533 |
534 // Can't shutdown now because we're in the middle of a callback from | 534 // Can't shutdown now because we're in the middle of a callback from |
535 // the CloudPolicyClient, so queue up a task to do the shutdown. | 535 // the CloudPolicyClient, so queue up a task to do the shutdown. |
536 MessageLoop::current()->PostTask( | 536 base::MessageLoop::current()->PostTask( |
537 FROM_HERE, | 537 FROM_HERE, |
538 base::Bind(&UserPolicySigninService::ShutdownUserCloudPolicyManager, | 538 base::Bind(&UserPolicySigninService::ShutdownUserCloudPolicyManager, |
539 weak_factory_.GetWeakPtr())); | 539 weak_factory_.GetWeakPtr())); |
540 } else { | 540 } else { |
541 DVLOG(1) << "Error fetching policy: " << client->status(); | 541 DVLOG(1) << "Error fetching policy: " << client->status(); |
542 } | 542 } |
543 } | 543 } |
544 } | 544 } |
545 | 545 |
546 void UserPolicySigninService::RegisterCloudPolicyService( | 546 void UserPolicySigninService::RegisterCloudPolicyService( |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 // before UserCloudPolicyManager shuts down the CloudPolicyClient. | 582 // before UserCloudPolicyManager shuts down the CloudPolicyClient. |
583 registration_helper_.reset(); | 583 registration_helper_.reset(); |
584 StopObserving(); | 584 StopObserving(); |
585 } | 585 } |
586 | 586 |
587 UserCloudPolicyManager* UserPolicySigninService::GetManager() { | 587 UserCloudPolicyManager* UserPolicySigninService::GetManager() { |
588 return UserCloudPolicyManagerFactory::GetForProfile(profile_); | 588 return UserCloudPolicyManagerFactory::GetForProfile(profile_); |
589 } | 589 } |
590 | 590 |
591 } // namespace policy | 591 } // namespace policy |
OLD | NEW |