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

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

Issue 2834042: Add IssueAuthToken and unit tests to GaiaAuthenticator2. (Closed)
Patch Set: Created 10 years, 5 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/google_authenticator.h" 5 #include "chrome/browser/chromeos/login/google_authenticator.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/file_path.h" 10 #include "base/file_path.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 151
152 LOG(INFO) << "Online login successful!"; 152 LOG(INFO) << "Online login successful!";
153 ClearClientLoginAttempt(); 153 ClearClientLoginAttempt();
154 154
155 ChromeThread::PostTask( 155 ChromeThread::PostTask(
156 ChromeThread::UI, FROM_HERE, 156 ChromeThread::UI, FROM_HERE,
157 NewRunnableMethod(this, &GoogleAuthenticator::OnLoginSuccess, result)); 157 NewRunnableMethod(this, &GoogleAuthenticator::OnLoginSuccess, result));
158 } 158 }
159 159
160 void GoogleAuthenticator::OnClientLoginFailure( 160 void GoogleAuthenticator::OnClientLoginFailure(
161 const GaiaAuthConsumer::ClientLoginError& error) { 161 const GaiaAuthConsumer::GaiaAuthError& error) {
162 162
163 if (error.code == GaiaAuthConsumer::REQUEST_CANCELED) { 163 if (error.code == GaiaAuthConsumer::REQUEST_CANCELED) {
164 if (try_again_) { 164 if (try_again_) {
165 try_again_ = false; 165 try_again_ = false;
166 LOG(ERROR) << "Login attempt canceled!?!? Trying again."; 166 LOG(ERROR) << "Login attempt canceled!?!? Trying again.";
167 TryClientLogin(); 167 TryClientLogin();
168 return; 168 return;
169 } 169 }
170 LOG(ERROR) << "Login attempt canceled again? Already retried..."; 170 LOG(ERROR) << "Login attempt canceled again? Already retried...";
171 } 171 }
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 DCHECK_EQ(parts.size(), 2U) << "email_address should have only one @"; 374 DCHECK_EQ(parts.size(), 2U) << "email_address should have only one @";
375 RemoveChars(parts[0], ".", &parts[0]); 375 RemoveChars(parts[0], ".", &parts[0]);
376 if (parts[0].find('+') != std::string::npos) 376 if (parts[0].find('+') != std::string::npos)
377 parts[0].erase(parts[0].find('+')); 377 parts[0].erase(parts[0].find('+'));
378 std::string new_email = StringToLowerASCII(JoinString(parts, at)); 378 std::string new_email = StringToLowerASCII(JoinString(parts, at));
379 LOG(INFO) << "Canonicalized " << email_address << " to " << new_email; 379 LOG(INFO) << "Canonicalized " << email_address << " to " << new_email;
380 return new_email; 380 return new_email;
381 } 381 }
382 382
383 } // namespace chromeos 383 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698