OLD | NEW |
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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 unlock_(false), | 56 unlock_(false), |
57 try_again_(true), | 57 try_again_(true), |
58 checked_for_localaccount_(false) { | 58 checked_for_localaccount_(false) { |
59 CHECK(chromeos::CrosLibrary::Get()->EnsureLoaded()); | 59 CHECK(chromeos::CrosLibrary::Get()->EnsureLoaded()); |
60 } | 60 } |
61 | 61 |
62 GoogleAuthenticator::~GoogleAuthenticator() {} | 62 GoogleAuthenticator::~GoogleAuthenticator() {} |
63 | 63 |
64 void GoogleAuthenticator::CancelClientLogin() { | 64 void GoogleAuthenticator::CancelClientLogin() { |
65 if (gaia_authenticator_->HasPendingFetch()) { | 65 if (gaia_authenticator_->HasPendingFetch()) { |
| 66 LOG(INFO) << "Canceling ClientLogin attempt."; |
66 gaia_authenticator_->CancelRequest(); | 67 gaia_authenticator_->CancelRequest(); |
| 68 |
| 69 ChromeThread::PostTask( |
| 70 ChromeThread::FILE, FROM_HERE, |
| 71 NewRunnableMethod(this, |
| 72 &GoogleAuthenticator::LoadLocalaccount, |
| 73 std::string(kLocalaccountFile))); |
| 74 |
67 CheckOffline("Login has timed out; please try again!"); | 75 CheckOffline("Login has timed out; please try again!"); |
68 } | 76 } |
69 } | 77 } |
70 | 78 |
71 void GoogleAuthenticator::TryClientLogin() { | 79 void GoogleAuthenticator::TryClientLogin() { |
72 gaia_authenticator_->StartClientLogin(username_, | 80 gaia_authenticator_->StartClientLogin(username_, |
73 password_, | 81 password_, |
74 GaiaAuthenticator2::kContactsService, | 82 GaiaAuthenticator2::kContactsService, |
75 login_token_, | 83 login_token_, |
76 login_captcha_); | 84 login_captcha_); |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 DCHECK_EQ(parts.size(), 2U) << "email_address should have only one @"; | 430 DCHECK_EQ(parts.size(), 2U) << "email_address should have only one @"; |
423 RemoveChars(parts[0], ".", &parts[0]); | 431 RemoveChars(parts[0], ".", &parts[0]); |
424 if (parts[0].find('+') != std::string::npos) | 432 if (parts[0].find('+') != std::string::npos) |
425 parts[0].erase(parts[0].find('+')); | 433 parts[0].erase(parts[0].find('+')); |
426 std::string new_email = StringToLowerASCII(JoinString(parts, at)); | 434 std::string new_email = StringToLowerASCII(JoinString(parts, at)); |
427 LOG(INFO) << "Canonicalized " << email_address << " to " << new_email; | 435 LOG(INFO) << "Canonicalized " << email_address << " to " << new_email; |
428 return new_email; | 436 return new_email; |
429 } | 437 } |
430 | 438 |
431 } // namespace chromeos | 439 } // namespace chromeos |
OLD | NEW |