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

Unified Diff: chrome/browser/chromeos/arc/arc_auth_service.cc

Issue 2114463002: arc: Notify the user on fatal opt-in flow errors (Closed) Base URL: https://chromium.googlesource.com/a/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/arc/arc_auth_service.cc
diff --git a/chrome/browser/chromeos/arc/arc_auth_service.cc b/chrome/browser/chromeos/arc/arc_auth_service.cc
index fa411b4d0c88bb02e3d88754c257cca16d1ac221..dfb30c43aaff0b741f71c05ba7244d97a88bda18 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -195,6 +195,12 @@ void ArcAuthService::OnAuthInstanceReady() {
}
void ArcAuthService::OnBridgeStopped() {
+ if (waiting_for_reply_) {
+ // Using SERVICE_UNAVAILABLE instead of UNKNOWN_ERROR, since the latter
+ // causes this code to not try to stop ARC, so it would retry without the
+ // user noticing.
+ OnSignInFailed(arc::mojom::ArcSignInFailureReason::SERVICE_UNAVAILABLE);
+ }
if (!clear_required_)
return;
clear_required_ = false;
@@ -237,6 +243,8 @@ void ArcAuthService::OnSignInComplete() {
DCHECK_EQ(state_, State::ACTIVE);
DCHECK(!sign_in_time_.is_null());
+ waiting_for_reply_ = false;
Luis Héctor Chávez 2016/06/29 23:37:50 If adding this flag is undesirable, all the places
+
if (!IsOptInVerificationDisabled() &&
!profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn)) {
playstore_launcher_.reset(
@@ -255,6 +263,8 @@ void ArcAuthService::OnSignInFailed(arc::mojom::ArcSignInFailureReason reason) {
DCHECK_EQ(state_, State::ACTIVE);
DCHECK(!sign_in_time_.is_null());
+ waiting_for_reply_ = false;
+
UpdateProvisioningTiming(base::Time::Now() - sign_in_time_, false,
IsAccountManaged(profile_));
int error_message_id;
@@ -564,6 +574,7 @@ void ArcAuthService::SetAuthCodeAndStartArc(const std::string& auth_code) {
SetUIPage(UIPage::START_PROGRESS, base::string16());
ShutdownBridge();
auth_code_ = auth_code;
+ waiting_for_reply_ = true;
StartArc();
}
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698