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

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

Issue 2705213002: Show different error message if ARC is disabled. (Closed)
Patch Set: Rebase Created 3 years, 9 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') | chrome/browser/chromeos/arc/arc_optin_uma.h » ('j') | 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 baf1adb03422b700f05b50f28ee9bd1b174252e1..989f1a6907e3b85aae16e129fba043762d12480e 100644
--- a/chrome/browser/chromeos/arc/arc_auth_service.cc
+++ b/chrome/browser/chromeos/arc/arc_auth_service.cc
@@ -12,7 +12,6 @@
#include "chrome/browser/chromeos/arc/arc_optin_uma.h"
#include "chrome/browser/chromeos/arc/arc_session_manager.h"
#include "chrome/browser/chromeos/arc/auth/arc_active_directory_enrollment_token_fetcher.h"
-#include "chrome/browser/chromeos/arc/auth/arc_auth_info_fetcher.h"
#include "chrome/browser/chromeos/arc/auth/arc_background_auth_code_fetcher.h"
#include "chrome/browser/chromeos/arc/auth/arc_manual_auth_code_fetcher.h"
#include "chrome/browser/chromeos/arc/auth/arc_robot_auth_code_fetcher.h"
@@ -290,26 +289,35 @@ void ArcAuthService::RequestAccountInfoInternal(
}
void ArcAuthService::OnEnrollmentTokenFetched(
+ ArcAuthInfoFetcher::Status 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 ArcAuthInfoFetcher::Status::SUCCESS:
+ notifier_->Notify(true /*is_enforced*/, enrollment_token,
+ mojom::ChromeAccountType::ACTIVE_DIRECTORY_ACCOUNT,
+ true);
+ notifier_.reset();
+ return;
+ case ArcAuthInfoFetcher::Status::FAILURE:
+ ArcSessionManager::Get()->OnProvisioningFinished(
+ ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR);
+ return;
+ case ArcAuthInfoFetcher::Status::ARC_DISABLED:
+ ArcSessionManager::Get()->OnProvisioningFinished(
+ ProvisioningResult::ARC_DISABLED);
+ 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(ArcAuthInfoFetcher::Status status,
+ const std::string& auth_code) {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
fetcher_.reset();
- if (auth_code.empty()) {
+ if (status != ArcAuthInfoFetcher::Status::SUCCESS) {
ArcSessionManager::Get()->OnProvisioningFinished(
ProvisioningResult::CHROME_SERVER_COMMUNICATION_ERROR);
return;
« no previous file with comments | « chrome/browser/chromeos/arc/arc_auth_service.h ('k') | chrome/browser/chromeos/arc/arc_optin_uma.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698