OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/chromeos/arc/arc_auth_service.h" | 5 #include "chrome/browser/chromeos/arc/arc_auth_service.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/shelf/shelf_delegate.h" | 9 #include "ash/shelf/shelf_delegate.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 185 } |
186 | 186 |
187 return true; | 187 return true; |
188 } | 188 } |
189 | 189 |
190 void ArcAuthService::OnInstanceReady() { | 190 void ArcAuthService::OnInstanceReady() { |
191 arc_bridge_service()->auth()->instance()->Init( | 191 arc_bridge_service()->auth()->instance()->Init( |
192 binding_.CreateInterfacePtrAndBind()); | 192 binding_.CreateInterfacePtrAndBind()); |
193 } | 193 } |
194 | 194 |
195 void ArcAuthService::OnBridgeStopped() { | 195 void ArcAuthService::OnBridgeStopped(ArcBridgeService::StopReason reason) { |
| 196 // TODO(crbug.com/625923): Use |reason| to report more detailed errors. |
196 if (waiting_for_reply_) { | 197 if (waiting_for_reply_) { |
197 // Using SERVICE_UNAVAILABLE instead of UNKNOWN_ERROR, since the latter | 198 // Using SERVICE_UNAVAILABLE instead of UNKNOWN_ERROR, since the latter |
198 // causes this code to not try to stop ARC, so it would retry without the | 199 // causes this code to not try to stop ARC, so it would retry without the |
199 // user noticing. | 200 // user noticing. |
200 OnSignInFailed(mojom::ArcSignInFailureReason::SERVICE_UNAVAILABLE); | 201 OnSignInFailed(mojom::ArcSignInFailureReason::SERVICE_UNAVAILABLE); |
201 } | 202 } |
202 if (!clear_required_) | 203 if (!clear_required_) |
203 return; | 204 return; |
204 clear_required_ = false; | 205 clear_required_ = false; |
205 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->RemoveArcData( | 206 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->RemoveArcData( |
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 return os << kStateFetchingCode; | 751 return os << kStateFetchingCode; |
751 case ArcAuthService::State::ACTIVE: | 752 case ArcAuthService::State::ACTIVE: |
752 return os << kStateActive; | 753 return os << kStateActive; |
753 default: | 754 default: |
754 NOTREACHED(); | 755 NOTREACHED(); |
755 return os; | 756 return os; |
756 } | 757 } |
757 } | 758 } |
758 | 759 |
759 } // namespace arc | 760 } // namespace arc |
OLD | NEW |