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

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

Issue 12256046: Added interstitial page for merge session. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/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/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 void OAuth2LoginManager::OnSessionMergeSuccess() { 236 void OAuth2LoginManager::OnSessionMergeSuccess() {
237 LOG(INFO) << "OAuth2 refresh and/or GAIA token verification succeeded."; 237 LOG(INFO) << "OAuth2 refresh and/or GAIA token verification succeeded.";
238 state_ = OAuthLoginManager::SESSION_RESTORE_DONE; 238 state_ = OAuthLoginManager::SESSION_RESTORE_DONE;
239 UserManager::Get()->SaveUserOAuthStatus( 239 UserManager::Get()->SaveUserOAuthStatus(
240 UserManager::Get()->GetLoggedInUser()->email(), 240 UserManager::Get()->GetLoggedInUser()->email(),
241 User::OAUTH2_TOKEN_STATUS_VALID); 241 User::OAUTH2_TOKEN_STATUS_VALID);
242 UMA_HISTOGRAM_ENUMERATION("OAuth2Login.SessionRestore", 242 UMA_HISTOGRAM_ENUMERATION("OAuth2Login.SessionRestore",
243 SESSION_RESTORE_SUCCESS, 243 SESSION_RESTORE_SUCCESS,
244 SESSION_RESTORE_COUNT); 244 SESSION_RESTORE_COUNT);
245 delegate_->OnCompletedMergeSession();
245 } 246 }
246 247
247 void OAuth2LoginManager::OnSessionMergeFailure() { 248 void OAuth2LoginManager::OnSessionMergeFailure() {
248 LOG(ERROR) << "OAuth2 refresh and GAIA token verification failed!"; 249 LOG(ERROR) << "OAuth2 refresh and GAIA token verification failed!";
249 state_ = OAuthLoginManager::SESSION_RESTORE_DONE; 250 state_ = OAuthLoginManager::SESSION_RESTORE_DONE;
250 UserManager::Get()->SaveUserOAuthStatus( 251 UserManager::Get()->SaveUserOAuthStatus(
251 UserManager::Get()->GetLoggedInUser()->email(), 252 UserManager::Get()->GetLoggedInUser()->email(),
252 User::OAUTH2_TOKEN_STATUS_INVALID); 253 User::OAUTH2_TOKEN_STATUS_INVALID);
253 UMA_HISTOGRAM_ENUMERATION("OAuth2Login.SessionRestore", 254 UMA_HISTOGRAM_ENUMERATION("OAuth2Login.SessionRestore",
254 SESSION_RESTORE_MERGE_SESSION_FAILED, 255 SESSION_RESTORE_MERGE_SESSION_FAILED,
255 SESSION_RESTORE_COUNT); 256 SESSION_RESTORE_COUNT);
257 delegate_->OnCompletedMergeSession();
256 } 258 }
257 259
258 void OAuth2LoginManager::StartTokenService( 260 void OAuth2LoginManager::StartTokenService(
259 const GaiaAuthConsumer::ClientLoginResult& gaia_credentials) { 261 const GaiaAuthConsumer::ClientLoginResult& gaia_credentials) {
260 TokenService* token_service = SetupTokenService(); 262 TokenService* token_service = SetupTokenService();
261 token_service->UpdateCredentials(gaia_credentials); 263 token_service->UpdateCredentials(gaia_credentials);
262 CompleteAuthentication(); 264 CompleteAuthentication();
263 } 265 }
264 266
265 } // namespace chromeos 267 } // 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