| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_base.h" | 5 #include "chrome/browser/policy/cloud/user_policy_signin_service_base.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 if (client->status() == DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED) { | 113 if (client->status() == DM_STATUS_SERVICE_MANAGEMENT_NOT_SUPPORTED) { |
| 114 // OK, policy fetch failed with MANAGEMENT_NOT_SUPPORTED - this is our | 114 // OK, policy fetch failed with MANAGEMENT_NOT_SUPPORTED - this is our |
| 115 // trigger to revert to "unmanaged" mode (we will check for management | 115 // trigger to revert to "unmanaged" mode (we will check for management |
| 116 // being re-enabled on the next restart and/or login). | 116 // being re-enabled on the next restart and/or login). |
| 117 DVLOG(1) << "DMServer returned NOT_SUPPORTED error - removing policy"; | 117 DVLOG(1) << "DMServer returned NOT_SUPPORTED error - removing policy"; |
| 118 | 118 |
| 119 // Can't shutdown now because we're in the middle of a callback from | 119 // Can't shutdown now because we're in the middle of a callback from |
| 120 // the CloudPolicyClient, so queue up a task to do the shutdown. | 120 // the CloudPolicyClient, so queue up a task to do the shutdown. |
| 121 base::ThreadTaskRunnerHandle::Get()->PostTask( | 121 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 122 FROM_HERE, | 122 FROM_HERE, |
| 123 base::Bind( | 123 base::BindOnce( |
| 124 &UserPolicySigninServiceBase::ShutdownUserCloudPolicyManager, | 124 &UserPolicySigninServiceBase::ShutdownUserCloudPolicyManager, |
| 125 weak_factory_.GetWeakPtr())); | 125 weak_factory_.GetWeakPtr())); |
| 126 } else { | 126 } else { |
| 127 DVLOG(1) << "Error fetching policy: " << client->status(); | 127 DVLOG(1) << "Error fetching policy: " << client->status(); |
| 128 } | 128 } |
| 129 } | 129 } |
| 130 } | 130 } |
| 131 | 131 |
| 132 void UserPolicySigninServiceBase::Shutdown() { | 132 void UserPolicySigninServiceBase::Shutdown() { |
| 133 if (signin_manager()) | 133 if (signin_manager()) |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 } | 243 } |
| 244 | 244 |
| 245 void UserPolicySigninServiceBase::ShutdownUserCloudPolicyManager() { | 245 void UserPolicySigninServiceBase::ShutdownUserCloudPolicyManager() { |
| 246 PrepareForUserCloudPolicyManagerShutdown(); | 246 PrepareForUserCloudPolicyManagerShutdown(); |
| 247 UserCloudPolicyManager* manager = policy_manager(); | 247 UserCloudPolicyManager* manager = policy_manager(); |
| 248 if (manager) | 248 if (manager) |
| 249 manager->DisconnectAndRemovePolicy(); | 249 manager->DisconnectAndRemovePolicy(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 } // namespace policy | 252 } // namespace policy |
| OLD | NEW |