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

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

Issue 2412133004: arc: Restore broken auth code requst on demand. (Closed)
Patch Set: Created 4 years, 2 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 444063776658e23c5591542f6f87e3dd17b014af..e34e2e36b9798c17d2eae4edfad6b981fece0529 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -304,7 +304,7 @@ void ArcAuthService::GetAuthCodeDeprecated(
void ArcAuthService::GetAuthCode(const GetAuthCodeCallback& callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// GetAuthCodeAndAccountType operation must not be in progress.
- DCHECK(!auth_account_callback_.is_null());
+ DCHECK(auth_account_callback_.is_null());
const std::string auth_code = GetAndResetAuthCode();
const bool verification_disabled = IsOptInVerificationDisabled();
@@ -322,7 +322,7 @@ void ArcAuthService::GetAuthCodeAndAccountType(
const GetAuthCodeAndAccountTypeCallback& callback) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// GetAuthCode operation must not be in progress.
- DCHECK(!auth_callback_.is_null());
+ DCHECK(auth_callback_.is_null());
const std::string auth_code = GetAndResetAuthCode();
const bool verification_disabled = IsOptInVerificationDisabled();
@@ -337,6 +337,10 @@ void ArcAuthService::GetAuthCodeAndAccountType(
StartUI();
}
+bool ArcAuthService::IsAuthCodeRequest() {
+ return !auth_callback_.is_null() || !auth_account_callback_.is_null();
+}
+
void ArcAuthService::OnSignInComplete() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
DCHECK_EQ(state_, State::ACTIVE);
@@ -814,11 +818,11 @@ void ArcAuthService::DisableArc() {
void ArcAuthService::StartUI() {
hidehiko 2016/10/13 15:22:00 StartUI is called only from four places. - GetAuth
khmel 2016/10/13 15:30:19 Checks I added is real condition that prevents And
hidehiko 2016/10/13 15:44:32 I meant; - StartLso() should not use StartUI() con
khmel 2016/10/13 15:53:21 This is real case that blocks working re-auth proc
Yusuke Sato 2016/10/15 01:16:32 I'm wondering what's your request now based on the
hidehiko 2016/10/17 09:23:31 Or, maybe introducing two functions. void StartSu
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- if (!arc_bridge_service()->stopped()) {
+ if (!IsAuthCodeRequest() && !arc_bridge_service()->stopped()) {
// If the user attempts to re-enable ARC while the bridge is still running
// the user should not be able to continue until the bridge has stopped.
- ShowUI(UIPage::ERROR, l10n_util::GetStringUTF16(
- IDS_ARC_SIGN_IN_SERVICE_UNAVAILABLE_ERROR));
khmel 2016/10/12 23:46:28 This error has nothing with "Couldn't reach Google
+ ShowUI(UIPage::ERROR,
+ l10n_util::GetStringUTF16(IDS_ARC_SIGN_IN_UNKNOWN_ERROR));
return;
}
@@ -904,11 +908,12 @@ void ArcAuthService::OnAndroidManagementChecked(
void ArcAuthService::StartArcIfSignedIn() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
- if (state_ == State::ACTIVE)
+ if (state_ == State::ACTIVE && !IsAuthCodeRequest())
hidehiko 2016/10/13 15:22:00 My understanding is that; ArcAuthService shows an
khmel 2016/10/13 15:30:19 It can be requested when Arc is running on second
hidehiko 2016/10/13 15:44:31 I understand |state_| can be ACTIVE in re-auth cas
khmel 2016/10/13 15:53:21 I don't see such case. I only see case with re-aut
Yusuke Sato 2016/10/15 01:16:32 Then we can revert line 911 to the original one?
hidehiko 2016/10/17 09:23:31 Reverting will cause a problem, because the new co
return;
- if (profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn) ||
- IsOptInVerificationDisabled()) {
+ if (!IsAuthCodeRequest() &&
hidehiko 2016/10/13 15:22:00 In this case, kArcSignedIn should be set to false
khmel 2016/10/13 15:30:19 If AuthCodeRequest is set then kArcSignedIn may be
hidehiko 2016/10/13 15:44:32 Isn't kArcSignedIn represents the ARC container si
khmel 2016/10/13 15:53:21 Re-auth may occur at any moment, with or without S
Yusuke Sato 2016/10/15 01:16:32 Ok, so we don't have to fix kArcSignedIn behavior
hidehiko 2016/10/17 09:23:31 https://cs.chromium.org/chromium/src/chrome/common
+ (profile_->GetPrefs()->GetBoolean(prefs::kArcSignedIn) ||
+ IsOptInVerificationDisabled())) {
StartArc();
} else {
const base::CommandLine* command_line =
« 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