| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/login_performer.h" | 5 #include "chrome/browser/chromeos/login/login_performer.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 void LoginPerformer::ResolveScreenUnlocked() { | 474 void LoginPerformer::ResolveScreenUnlocked() { |
| 475 DVLOG(1) << "Screen unlocked"; | 475 DVLOG(1) << "Screen unlocked"; |
| 476 registrar_.RemoveAll(); | 476 registrar_.RemoveAll(); |
| 477 // If screen was unlocked that was for a reason, should delete itself now. | 477 // If screen was unlocked that was for a reason, should delete itself now. |
| 478 MessageLoop::current()->DeleteSoon(FROM_HERE, this); | 478 MessageLoop::current()->DeleteSoon(FROM_HERE, this); |
| 479 } | 479 } |
| 480 | 480 |
| 481 void LoginPerformer::StartLoginCompletion() { | 481 void LoginPerformer::StartLoginCompletion() { |
| 482 DVLOG(1) << "Login completion started"; | 482 DVLOG(1) << "Login completion started"; |
| 483 BootTimesLoader::Get()->AddLoginTimeMarker("AuthStarted", false); | 483 BootTimesLoader::Get()->AddLoginTimeMarker("AuthStarted", false); |
| 484 Profile* profile = g_browser_process->profile_manager()->GetDefaultProfile(); | 484 Profile* profile = ProfileManager::GetSigninProfile(); |
| 485 | 485 |
| 486 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); | 486 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); |
| 487 BrowserThread::PostTask( | 487 BrowserThread::PostTask( |
| 488 BrowserThread::UI, FROM_HERE, | 488 BrowserThread::UI, FROM_HERE, |
| 489 base::Bind(&Authenticator::CompleteLogin, authenticator_.get(), | 489 base::Bind(&Authenticator::CompleteLogin, authenticator_.get(), |
| 490 profile, | 490 profile, |
| 491 user_context_)); | 491 user_context_)); |
| 492 | 492 |
| 493 user_context_.password.clear(); | 493 user_context_.password.clear(); |
| 494 user_context_.auth_code.clear(); | 494 user_context_.auth_code.clear(); |
| 495 } | 495 } |
| 496 | 496 |
| 497 void LoginPerformer::StartAuthentication() { | 497 void LoginPerformer::StartAuthentication() { |
| 498 DVLOG(1) << "Auth started"; | 498 DVLOG(1) << "Auth started"; |
| 499 BootTimesLoader::Get()->AddLoginTimeMarker("AuthStarted", false); | 499 BootTimesLoader::Get()->AddLoginTimeMarker("AuthStarted", false); |
| 500 Profile* profile; | 500 Profile* profile = ProfileManager::GetSigninProfile(); |
| 501 { | |
| 502 // This should be the first place where GetDefaultProfile() is called with | |
| 503 // logged_in_ = true. This will trigger a call to Profile::CreateProfile() | |
| 504 // which requires IO access. | |
| 505 base::ThreadRestrictions::ScopedAllowIO allow_io; | |
| 506 profile = g_browser_process->profile_manager()->GetDefaultProfile(); | |
| 507 } | |
| 508 if (delegate_) { | 501 if (delegate_) { |
| 509 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); | 502 authenticator_ = LoginUtils::Get()->CreateAuthenticator(this); |
| 510 BrowserThread::PostTask( | 503 BrowserThread::PostTask( |
| 511 BrowserThread::UI, FROM_HERE, | 504 BrowserThread::UI, FROM_HERE, |
| 512 base::Bind(&Authenticator::AuthenticateToLogin, authenticator_.get(), | 505 base::Bind(&Authenticator::AuthenticateToLogin, authenticator_.get(), |
| 513 profile, | 506 profile, |
| 514 user_context_, | 507 user_context_, |
| 515 std::string(), | 508 std::string(), |
| 516 std::string())); | 509 std::string())); |
| 517 // Make unobtrusive online check. It helps to determine password change | 510 // Make unobtrusive online check. It helps to determine password change |
| (...skipping 10 matching lines...) Expand all Loading... |
| 528 profile, | 521 profile, |
| 529 user_context_, | 522 user_context_, |
| 530 std::string(), | 523 std::string(), |
| 531 std::string())); | 524 std::string())); |
| 532 } | 525 } |
| 533 user_context_.password.clear(); | 526 user_context_.password.clear(); |
| 534 user_context_.auth_code.clear(); | 527 user_context_.auth_code.clear(); |
| 535 } | 528 } |
| 536 | 529 |
| 537 } // namespace chromeos | 530 } // namespace chromeos |
| OLD | NEW |