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

Side by Side Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 1128923006: Do not invalidate OAuth token status user when token handle is invalid. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/screens/user_selection_screen.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/login/existing_user_controller.h" 5 #include "chrome/browser/chromeos/login/existing_user_controller.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 if (!success) { 1234 if (!success) {
1235 LOG(ERROR) << "OAuth2 token fetch failed."; 1235 LOG(ERROR) << "OAuth2 token fetch failed.";
1236 OnAuthFailure(AuthFailure(AuthFailure::FAILED_TO_INITIALIZE_TOKEN)); 1236 OnAuthFailure(AuthFailure(AuthFailure::FAILED_TO_INITIALIZE_TOKEN));
1237 return; 1237 return;
1238 } 1238 }
1239 if (StartupUtils::IsWebviewSigninEnabled()) { 1239 if (StartupUtils::IsWebviewSigninEnabled()) {
1240 if (!token_handle_util_.get()) { 1240 if (!token_handle_util_.get()) {
1241 token_handle_util_.reset( 1241 token_handle_util_.reset(
1242 new TokenHandleUtil(user_manager::UserManager::Get())); 1242 new TokenHandleUtil(user_manager::UserManager::Get()));
1243 } 1243 }
1244 if (!token_handle_util_->HasToken(user_context.GetUserID())) { 1244 if (token_handle_util_->ShouldObtainHandle(user_context.GetUserID())) {
1245 token_handle_util_->GetTokenHandle( 1245 token_handle_util_->GetTokenHandle(
1246 user_context.GetUserID(), user_context.GetAccessToken(), 1246 user_context.GetUserID(), user_context.GetAccessToken(),
1247 base::Bind(&ExistingUserController::OnTokenHandleObtained, 1247 base::Bind(&ExistingUserController::OnTokenHandleObtained,
1248 weak_factory_.GetWeakPtr())); 1248 weak_factory_.GetWeakPtr()));
1249 } 1249 }
1250 } 1250 }
1251 PerformLogin(user_context, LoginPerformer::AUTH_MODE_EXTENSION); 1251 PerformLogin(user_context, LoginPerformer::AUTH_MODE_EXTENSION);
1252 } 1252 }
1253 1253
1254 void ExistingUserController::OnTokenHandleObtained( 1254 void ExistingUserController::OnTokenHandleObtained(
1255 const user_manager::UserID& id, 1255 const user_manager::UserID& id,
1256 TokenHandleUtil::TokenHandleStatus status) { 1256 TokenHandleUtil::TokenHandleStatus status) {
1257 if (status != TokenHandleUtil::VALID) { 1257 if (status != TokenHandleUtil::VALID) {
1258 LOG(ERROR) << "OAuth2 token handle fetch failed."; 1258 LOG(ERROR) << "OAuth2 token handle fetch failed.";
1259 return; 1259 return;
1260 } 1260 }
1261 } 1261 }
1262 1262
1263 } // namespace chromeos 1263 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/screens/user_selection_screen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698