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

Unified Diff: chrome/browser/chromeos/policy/wildcard_login_checker.cc

Issue 181363002: Properly handle failure modes in the wildcard login check. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/policy/wildcard_login_checker.cc
diff --git a/chrome/browser/chromeos/policy/wildcard_login_checker.cc b/chrome/browser/chromeos/policy/wildcard_login_checker.cc
index 44a40b6b9c7679234929015eafbc53eefe68c9a7..7fa0253ac12f0d287a31ff2c3d6adfa30c9089da 100644
--- a/chrome/browser/chromeos/policy/wildcard_login_checker.cc
+++ b/chrome/browser/chromeos/policy/wildcard_login_checker.cc
@@ -71,13 +71,14 @@ void WildcardLoginChecker::OnGetUserInfoSuccess(
now - start_timestamp_);
}
- OnCheckCompleted(response->HasKey(kHostedDomainKey));
+ OnCheckCompleted(response->HasKey(kHostedDomainKey) ? RESULT_ALLOWED
+ : RESULT_BLOCKED);
}
void WildcardLoginChecker::OnGetUserInfoFailure(
const GoogleServiceAuthError& error) {
LOG(ERROR) << "Failed to fetch user info " << error.ToString();
- OnCheckCompleted(false);
+ OnCheckCompleted(RESULT_FAILED);
}
void WildcardLoginChecker::OnPolicyTokenFetched(
@@ -85,7 +86,7 @@ void WildcardLoginChecker::OnPolicyTokenFetched(
const GoogleServiceAuthError& error) {
if (error.state() != GoogleServiceAuthError::NONE) {
LOG(ERROR) << "Failed to fetch policy token " << error.ToString();
- OnCheckCompleted(false);
+ OnCheckCompleted(RESULT_FAILED);
return;
}
@@ -106,7 +107,7 @@ void WildcardLoginChecker::StartUserInfoFetcher(
user_info_fetcher_->Start(access_token);
}
-void WildcardLoginChecker::OnCheckCompleted(bool result) {
+void WildcardLoginChecker::OnCheckCompleted(Result result) {
if (!callback_.is_null())
callback_.Run(result);
}

Powered by Google App Engine
This is Rietveld 408576698