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

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

Issue 2476973003: Remove initial_opt_in_ field. (Closed)
Patch Set: Address comment.s Created 4 years, 1 month 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 aadfbef78caef4670e34642aef3d7d97535122e0..b73f66a5d5d3dbd077f85a08b4ed5f4f0d415623 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -400,9 +400,7 @@ void ArcAuthService::PrepareContextForAuthCodeRequest() {
// 3. For any other state on Android side that leads device appears in
// non-signed state.
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- DCHECK(IsAuthCodeRequest());
- DCHECK_EQ(state_, State::ACTIVE);
- initial_opt_in_ = false;
+ DCHECK(state_ != State::ACTIVE || IsAuthCodeRequest());
context_->PrepareContext();
}
@@ -633,8 +631,6 @@ void ArcAuthService::ShowUI(UIPage page, const base::string16& status) {
void ArcAuthService::OnContextReady() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- DCHECK(!initial_opt_in_);
-
// TODO(hidehiko): The check is not necessary if this is a part of re-auth
// flow. Remove this.
android_management_checker_.reset(new ArcAndroidManagementChecker(
@@ -696,7 +692,6 @@ void ArcAuthService::OnOptInPreferenceChanged() {
if (!profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn)) {
// Need pre-fetch auth code and show OptIn UI if needed.
- initial_opt_in_ = true;
StartUI();
} else {
// Ready to start Arc, but check Android management in parallel.
@@ -831,9 +826,9 @@ void ArcAuthService::StartLso() {
ShutdownBridge();
}
- // TODO(khmel): Use PrepareContextForAuthCodeRequest for this case.
- initial_opt_in_ = false;
- StartUI();
+ DCHECK(arc_bridge_service()->stopped());
+ SetState(State::FETCHING_CODE);
+ PrepareContextForAuthCodeRequest();
}
void ArcAuthService::CancelAuthCode() {
@@ -912,13 +907,7 @@ void ArcAuthService::StartUI() {
}
SetState(State::FETCHING_CODE);
-
- if (initial_opt_in_) {
- initial_opt_in_ = false;
- ShowUI(UIPage::TERMS, base::string16());
- } else {
- context_->PrepareContext();
- }
+ ShowUI(UIPage::TERMS, base::string16());
}
void ArcAuthService::OnPrepareContextFailed() {
« 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