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

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

Issue 2705213002: Show different error message if ARC is disabled. (Closed)
Patch Set: Fix browsertests and add a new test for 904 Arc Disabled Created 3 years, 10 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
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 33a82f001cbe9adc2726f57d4ff0a363d47e2028..3cd324f2a196da2a0ded54b5a21d25e88900b264 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -267,26 +267,35 @@ void ArcAuthService::RequestAccountInfoInternal(
}
void ArcAuthService::OnEnrollmentTokenFetched(
+ ArcAuthInfoFetchStatus status,
const std::string& enrollment_token) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
fetcher_.reset();
- if (enrollment_token.empty()) {
- ArcSessionManager::Get()->OnProvisioningFinished(
- ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR);
- return;
+ switch (status) {
+ case ArcAuthInfoFetchStatus::SUCCESS:
+ notifier_->Notify(true /*is_enforced*/, enrollment_token,
+ mojom::ChromeAccountType::ACTIVE_DIRECTORY_ACCOUNT,
+ true);
+ notifier_.reset();
+ return;
+ case ArcAuthInfoFetchStatus::ARC_DISABLED:
+ ArcSessionManager::Get()->OnProvisioningFinished(
+ ProvisioningResult::ARC_DISABLED);
+ return;
+ default:
+ ArcSessionManager::Get()->OnProvisioningFinished(
+ ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR);
+ return;
}
-
- notifier_->Notify(true /*is_enforced*/, enrollment_token,
- mojom::ChromeAccountType::ACTIVE_DIRECTORY_ACCOUNT, true);
- notifier_.reset();
}
-void ArcAuthService::OnAuthCodeFetched(const std::string& auth_code) {
+void ArcAuthService::OnAuthCodeFetched(ArcAuthInfoFetchStatus status,
+ const std::string& auth_code) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
fetcher_.reset();
- if (auth_code.empty()) {
+ if (status != ArcAuthInfoFetchStatus::SUCCESS) {
ArcSessionManager::Get()->OnProvisioningFinished(
ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR);
return;

Powered by Google App Engine
This is Rietveld 408576698