| 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/parallel_authenticator.h" | 5 #include "chrome/browser/chromeos/login/parallel_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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 BrowserThread::IO, FROM_HERE, | 266 BrowserThread::IO, FROM_HERE, |
| 267 NewRunnableMethod(current_online_.get(), | 267 NewRunnableMethod(current_online_.get(), |
| 268 &OnlineAttempt::Initiate, | 268 &OnlineAttempt::Initiate, |
| 269 profile)); | 269 profile)); |
| 270 } | 270 } |
| 271 | 271 |
| 272 void ParallelAuthenticator::Resolve() { | 272 void ParallelAuthenticator::Resolve() { |
| 273 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 273 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 274 bool request_pending = false; | 274 bool request_pending = false; |
| 275 bool create = false; | 275 bool create = false; |
| 276 switch (ResolveState()) { | 276 ParallelAuthenticator::AuthState state = ResolveState(); |
| 277 VLOG(1) << "Resolved state to: " << state; |
| 278 switch (state) { |
| 277 case CONTINUE: | 279 case CONTINUE: |
| 278 case POSSIBLE_PW_CHANGE: | 280 case POSSIBLE_PW_CHANGE: |
| 279 case NO_MOUNT: | 281 case NO_MOUNT: |
| 280 // These are intermediate states; we need more info from a request that | 282 // These are intermediate states; we need more info from a request that |
| 281 // is still pending. | 283 // is still pending. |
| 282 break; | 284 break; |
| 283 case FAILED_MOUNT: | 285 case FAILED_MOUNT: |
| 284 // In this case, whether login succeeded or not, we can't log | 286 // In this case, whether login succeeded or not, we can't log |
| 285 // the user in because their data is horked. So, override with | 287 // the user in because their data is horked. So, override with |
| 286 // the appropriate failure. | 288 // the appropriate failure. |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 const unsigned int len) { | 626 const unsigned int len) { |
| 625 if (len < 2*binary_len) | 627 if (len < 2*binary_len) |
| 626 return false; | 628 return false; |
| 627 memset(hex_string, 0, len); | 629 memset(hex_string, 0, len); |
| 628 for (uint i = 0, j = 0; i < binary_len; i++, j+=2) | 630 for (uint i = 0, j = 0; i < binary_len; i++, j+=2) |
| 629 snprintf(hex_string + j, len - j, "%02x", binary[i]); | 631 snprintf(hex_string + j, len - j, "%02x", binary[i]); |
| 630 return true; | 632 return true; |
| 631 } | 633 } |
| 632 | 634 |
| 633 } // namespace chromeos | 635 } // namespace chromeos |
| OLD | NEW |