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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } | 188 } |
189 | 189 |
190 return true; | 190 return true; |
191 } | 191 } |
192 | 192 |
193 void ArcAuthService::OnAuthInstanceReady() { | 193 void ArcAuthService::OnAuthInstanceReady() { |
194 arc_bridge_service()->auth_instance()->Init( | 194 arc_bridge_service()->auth_instance()->Init( |
195 binding_.CreateInterfacePtrAndBind()); | 195 binding_.CreateInterfacePtrAndBind()); |
196 } | 196 } |
197 | 197 |
198 void ArcAuthService::OnBridgeStopped() { | 198 void ArcAuthService::OnBridgeStopped(ArcBridgeService::StopReason reason) { |
| 199 // TODO(crbug.com/625923): Use |reason| to report more detailed errors. |
199 if (waiting_for_reply_) { | 200 if (waiting_for_reply_) { |
200 // Using SERVICE_UNAVAILABLE instead of UNKNOWN_ERROR, since the latter | 201 // Using SERVICE_UNAVAILABLE instead of UNKNOWN_ERROR, since the latter |
201 // causes this code to not try to stop ARC, so it would retry without the | 202 // causes this code to not try to stop ARC, so it would retry without the |
202 // user noticing. | 203 // user noticing. |
203 OnSignInFailed(arc::mojom::ArcSignInFailureReason::SERVICE_UNAVAILABLE); | 204 OnSignInFailed(arc::mojom::ArcSignInFailureReason::SERVICE_UNAVAILABLE); |
204 } | 205 } |
205 if (!clear_required_) | 206 if (!clear_required_) |
206 return; | 207 return; |
207 clear_required_ = false; | 208 clear_required_ = false; |
208 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->RemoveArcData( | 209 chromeos::DBusThreadManager::Get()->GetSessionManagerClient()->RemoveArcData( |
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
751 return os << kStateFetchingCode; | 752 return os << kStateFetchingCode; |
752 case ArcAuthService::State::ACTIVE: | 753 case ArcAuthService::State::ACTIVE: |
753 return os << kStateActive; | 754 return os << kStateActive; |
754 default: | 755 default: |
755 NOTREACHED(); | 756 NOTREACHED(); |
756 return os; | 757 return os; |
757 } | 758 } |
758 } | 759 } |
759 | 760 |
760 } // namespace arc | 761 } // namespace arc |
OLD | NEW |