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

Side by Side Diff: chrome/browser/chromeos/arc/arc_auth_service.cc

Issue 2133653002: arc: Notify ARC instance failures via callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address lhchavez's comments + improve unit test. Created 4 years, 5 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698