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

Unified Diff: chrome/browser/chromeos/login/signin/token_handle_util.cc

Issue 1191273002: ChromeOS: Show the new POD RE-AUTH ICON when users needs to re-auth (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update after review. Created 5 years, 6 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/login/signin/token_handle_util.cc
diff --git a/chrome/browser/chromeos/login/signin/token_handle_util.cc b/chrome/browser/chromeos/login/signin/token_handle_util.cc
index 4e688a747cf7e6da7bfd3aa19760e65547f027ef..1d954ff88058cc9a89b71cac963b86a107587b69 100644
--- a/chrome/browser/chromeos/login/signin/token_handle_util.cc
+++ b/chrome/browser/chromeos/login/signin/token_handle_util.cc
@@ -75,17 +75,17 @@ void TokenHandleUtil::MarkHandleInvalid(const user_manager::UserID& user_id) {
kHandleStatusInvalid);
}
-void TokenHandleUtil::CheckToken(const user_manager::UserID& user_id,
+bool TokenHandleUtil::CheckToken(const user_manager::UserID& user_id,
const TokenValidationCallback& callback) {
const base::DictionaryValue* dict = nullptr;
std::string token;
if (!user_manager_->FindKnownUserPrefs(user_id, &dict)) {
callback.Run(user_id, UNKNOWN);
- return;
+ return true;
}
if (!dict->GetString(kTokenHandlePref, &token)) {
callback.Run(user_id, UNKNOWN);
- return;
+ return true;
}
if (!gaia_client_.get()) {
@@ -93,12 +93,15 @@ void TokenHandleUtil::CheckToken(const user_manager::UserID& user_id,
chromeos::ProfileHelper::Get()->GetSigninProfile()->GetRequestContext();
gaia_client_.reset(new gaia::GaiaOAuthClient(request_context));
}
+ if (validation_delegates_.count(token) != 0)
+ return false;
validation_delegates_.set(
token, scoped_ptr<TokenDelegate>(new TokenDelegate(
weak_factory_.GetWeakPtr(), user_id, token, callback)));
gaia_client_->GetTokenHandleInfo(token, kMaxRetries,
validation_delegates_.get(token));
+ return true;
}
void TokenHandleUtil::StoreTokenHandle(const user_manager::UserID& user_id,

Powered by Google App Engine
This is Rietveld 408576698