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

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

Issue 12335051: Merge 182894 - 3rd attempt (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1364/src/
Patch Set: Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/oauth2_login_manager.h" 5 #include "chrome/browser/chromeos/login/oauth2_login_manager.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/chromeos/login/user_manager.h" 10 #include "chrome/browser/chromeos/login/user_manager.h"
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 231
232 void OAuth2LoginManager::OnSessionMergeSuccess() { 232 void OAuth2LoginManager::OnSessionMergeSuccess() {
233 LOG(INFO) << "OAuth2 refresh and/or GAIA token verification succeeded."; 233 LOG(INFO) << "OAuth2 refresh and/or GAIA token verification succeeded.";
234 state_ = OAuthLoginManager::SESSION_RESTORE_DONE; 234 state_ = OAuthLoginManager::SESSION_RESTORE_DONE;
235 UserManager::Get()->SaveUserOAuthStatus( 235 UserManager::Get()->SaveUserOAuthStatus(
236 UserManager::Get()->GetLoggedInUser()->email(), 236 UserManager::Get()->GetLoggedInUser()->email(),
237 User::OAUTH2_TOKEN_STATUS_VALID); 237 User::OAUTH2_TOKEN_STATUS_VALID);
238 UMA_HISTOGRAM_ENUMERATION("OAuth2Login.SessionRestore", 238 UMA_HISTOGRAM_ENUMERATION("OAuth2Login.SessionRestore",
239 SESSION_RESTORE_SUCCESS, 239 SESSION_RESTORE_SUCCESS,
240 SESSION_RESTORE_COUNT); 240 SESSION_RESTORE_COUNT);
241 delegate_->OnCompletedMergeSession();
241 } 242 }
242 243
243 void OAuth2LoginManager::OnSessionMergeFailure() { 244 void OAuth2LoginManager::OnSessionMergeFailure() {
244 LOG(ERROR) << "OAuth2 refresh and GAIA token verification failed!"; 245 LOG(ERROR) << "OAuth2 refresh and GAIA token verification failed!";
245 state_ = OAuthLoginManager::SESSION_RESTORE_DONE; 246 state_ = OAuthLoginManager::SESSION_RESTORE_DONE;
246 UserManager::Get()->SaveUserOAuthStatus( 247 UserManager::Get()->SaveUserOAuthStatus(
247 UserManager::Get()->GetLoggedInUser()->email(), 248 UserManager::Get()->GetLoggedInUser()->email(),
248 User::OAUTH2_TOKEN_STATUS_INVALID); 249 User::OAUTH2_TOKEN_STATUS_INVALID);
249 UMA_HISTOGRAM_ENUMERATION("OAuth2Login.SessionRestore", 250 UMA_HISTOGRAM_ENUMERATION("OAuth2Login.SessionRestore",
250 SESSION_RESTORE_MERGE_SESSION_FAILED, 251 SESSION_RESTORE_MERGE_SESSION_FAILED,
251 SESSION_RESTORE_COUNT); 252 SESSION_RESTORE_COUNT);
253 delegate_->OnCompletedMergeSession();
252 } 254 }
253 255
254 void OAuth2LoginManager::StartTokenService( 256 void OAuth2LoginManager::StartTokenService(
255 const GaiaAuthConsumer::ClientLoginResult& gaia_credentials) { 257 const GaiaAuthConsumer::ClientLoginResult& gaia_credentials) {
256 TokenService* token_service = SetupTokenService(); 258 TokenService* token_service = SetupTokenService();
257 token_service->UpdateCredentials(gaia_credentials); 259 token_service->UpdateCredentials(gaia_credentials);
258 CompleteAuthentication(); 260 CompleteAuthentication();
259 } 261 }
260 262
261 } // namespace chromeos 263 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/mock_user_manager.h ('k') | chrome/browser/chromeos/login/oauth_login_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698