| 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 failure_details)); | 234 failure_details)); |
| 235 LOG(WARNING) << "Rejecting valid HOSTED account."; | 235 LOG(WARNING) << "Rejecting valid HOSTED account."; |
| 236 hosted_policy_ = GaiaAuthFetcher::HostedAccountsNotAllowed; | 236 hosted_policy_ = GaiaAuthFetcher::HostedAccountsNotAllowed; |
| 237 return; | 237 return; |
| 238 } | 238 } |
| 239 | 239 |
| 240 ClearClientLoginAttempt(); | 240 ClearClientLoginAttempt(); |
| 241 | 241 |
| 242 if (error.state() == GoogleServiceAuthError::TWO_FACTOR) { | 242 if (error.state() == GoogleServiceAuthError::TWO_FACTOR) { |
| 243 LOG(WARNING) << "Two factor authenticated. Sync will not work."; | 243 LOG(WARNING) << "Two factor authenticated. Sync will not work."; |
| 244 OnClientLoginSuccess(GaiaAuthConsumer::ClientLoginResult()); | 244 GaiaAuthConsumer::ClientLoginResult result; |
| 245 result.two_factor = true; |
| 246 OnClientLoginSuccess(result); |
| 245 return; | 247 return; |
| 246 } | 248 } |
| 247 | 249 |
| 248 BrowserThread::PostTask( | 250 BrowserThread::PostTask( |
| 249 BrowserThread::FILE, FROM_HERE, | 251 BrowserThread::FILE, FROM_HERE, |
| 250 NewRunnableMethod(this, | 252 NewRunnableMethod(this, |
| 251 &GoogleAuthenticator::LoadLocalaccount, | 253 &GoogleAuthenticator::LoadLocalaccount, |
| 252 std::string(kLocalaccountFile))); | 254 std::string(kLocalaccountFile))); |
| 253 | 255 |
| 254 LoginFailure failure_details = LoginFailure::FromNetworkAuthFailure(error); | 256 LoginFailure failure_details = LoginFailure::FromNetworkAuthFailure(error); |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 const unsigned int len) { | 482 const unsigned int len) { |
| 481 if (len < 2*binary_len) | 483 if (len < 2*binary_len) |
| 482 return false; | 484 return false; |
| 483 memset(hex_string, 0, len); | 485 memset(hex_string, 0, len); |
| 484 for (uint i = 0, j = 0; i < binary_len; i++, j+=2) | 486 for (uint i = 0, j = 0; i < binary_len; i++, j+=2) |
| 485 snprintf(hex_string + j, len - j, "%02x", binary[i]); | 487 snprintf(hex_string + j, len - j, "%02x", binary[i]); |
| 486 return true; | 488 return true; |
| 487 } | 489 } |
| 488 | 490 |
| 489 } // namespace chromeos | 491 } // namespace chromeos |
| OLD | NEW |