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

Side by Side Diff: chrome/browser/policy/cloud/user_policy_signin_service.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 // come from a policy fetch. 530 // come from a policy fetch.
531 if (client->status() == 531 if (client->status() ==
532 policy::DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED) { 532 policy::DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED) {
533 // OK, policy fetch failed with MANAGEMENT_NOT_SUPPORTED - this is our 533 // OK, policy fetch failed with MANAGEMENT_NOT_SUPPORTED - this is our
534 // trigger to revert to "unmanaged" mode (we will check for management 534 // trigger to revert to "unmanaged" mode (we will check for management
535 // being re-enabled on the next restart and/or login). 535 // being re-enabled on the next restart and/or login).
536 DVLOG(1) << "DMServer returned NOT_SUPPORTED error - removing policy"; 536 DVLOG(1) << "DMServer returned NOT_SUPPORTED error - removing policy";
537 537
538 // Can't shutdown now because we're in the middle of a callback from 538 // Can't shutdown now because we're in the middle of a callback from
539 // the CloudPolicyClient, so queue up a task to do the shutdown. 539 // the CloudPolicyClient, so queue up a task to do the shutdown.
540 MessageLoop::current()->PostTask( 540 base::MessageLoop::current()->PostTask(
541 FROM_HERE, 541 FROM_HERE,
542 base::Bind(&UserPolicySigninService::ShutdownUserCloudPolicyManager, 542 base::Bind(&UserPolicySigninService::ShutdownUserCloudPolicyManager,
543 weak_factory_.GetWeakPtr())); 543 weak_factory_.GetWeakPtr()));
544 } else { 544 } else {
545 DVLOG(1) << "Error fetching policy: " << client->status(); 545 DVLOG(1) << "Error fetching policy: " << client->status();
546 } 546 }
547 } 547 }
548 } 548 }
549 549
550 void UserPolicySigninService::RegisterCloudPolicyService( 550 void UserPolicySigninService::RegisterCloudPolicyService(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 // before UserCloudPolicyManager shuts down the CloudPolicyClient. 586 // before UserCloudPolicyManager shuts down the CloudPolicyClient.
587 registration_helper_.reset(); 587 registration_helper_.reset();
588 StopObserving(); 588 StopObserving();
589 } 589 }
590 590
591 UserCloudPolicyManager* UserPolicySigninService::GetManager() { 591 UserCloudPolicyManager* UserPolicySigninService::GetManager() {
592 return UserCloudPolicyManagerFactory::GetForProfile(profile_); 592 return UserCloudPolicyManagerFactory::GetForProfile(profile_);
593 } 593 }
594 594
595 } // namespace policy 595 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698