| 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/parallel_authenticator.h" | 5 #include "chrome/browser/chromeos/login/parallel_authenticator.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 339 remove_user_data_on_failure_ = false; | 339 remove_user_data_on_failure_ = false; |
| 340 ephemeral_mount_attempted_ = true; | 340 ephemeral_mount_attempted_ = true; |
| 341 SystemSaltGetter::Get()->GetSystemSalt( | 341 SystemSaltGetter::Get()->GetSystemSalt( |
| 342 base::Bind(&Mount, | 342 base::Bind(&Mount, |
| 343 current_state_.get(), | 343 current_state_.get(), |
| 344 scoped_refptr<ParallelAuthenticator>(this), | 344 scoped_refptr<ParallelAuthenticator>(this), |
| 345 cryptohome::CREATE_IF_MISSING | cryptohome::ENSURE_EPHEMERAL)); | 345 cryptohome::CREATE_IF_MISSING | cryptohome::ENSURE_EPHEMERAL)); |
| 346 } | 346 } |
| 347 | 347 |
| 348 void ParallelAuthenticator::LoginAsKioskAccount( | 348 void ParallelAuthenticator::LoginAsKioskAccount( |
| 349 const std::string& app_user_id) { | 349 const std::string& app_user_id, bool force_ephemeral) { |
| 350 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 350 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 351 current_state_.reset(new AuthAttemptState( | 351 current_state_.reset(new AuthAttemptState( |
| 352 UserContext(app_user_id, | 352 UserContext(app_user_id, |
| 353 std::string(), // password | 353 std::string(), // password |
| 354 std::string()), // auth_code | 354 std::string()), // auth_code |
| 355 std::string(), // login_token | 355 std::string(), // login_token |
| 356 std::string(), // login_captcha | 356 std::string(), // login_captcha |
| 357 User::USER_TYPE_KIOSK_APP, | 357 User::USER_TYPE_KIOSK_APP, |
| 358 false)); | 358 false)); |
| 359 remove_user_data_on_failure_ = true; | 359 remove_user_data_on_failure_ = true; |
| 360 int ephemeral_flag = force_ephemeral ? cryptohome::ENSURE_EPHEMERAL : 0; |
| 360 MountPublic(current_state_.get(), | 361 MountPublic(current_state_.get(), |
| 361 scoped_refptr<ParallelAuthenticator>(this), | 362 scoped_refptr<ParallelAuthenticator>(this), |
| 362 cryptohome::CREATE_IF_MISSING); | 363 cryptohome::CREATE_IF_MISSING | ephemeral_flag); |
| 363 } | 364 } |
| 364 | 365 |
| 365 void ParallelAuthenticator::OnRetailModeLoginSuccess() { | 366 void ParallelAuthenticator::OnRetailModeLoginSuccess() { |
| 366 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 367 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 367 VLOG(1) << "Retail mode login success"; | 368 VLOG(1) << "Retail mode login success"; |
| 368 // Send notification of success | 369 // Send notification of success |
| 369 AuthenticationNotificationDetails details(true); | 370 AuthenticationNotificationDetails details(true); |
| 370 content::NotificationService::current()->Notify( | 371 content::NotificationService::current()->Notify( |
| 371 chrome::NOTIFICATION_LOGIN_AUTHENTICATION, | 372 chrome::NOTIFICATION_LOGIN_AUTHENTICATION, |
| 372 content::NotificationService::AllSources(), | 373 content::NotificationService::AllSources(), |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 806 Resolve(); | 807 Resolve(); |
| 807 } | 808 } |
| 808 | 809 |
| 809 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, | 810 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, |
| 810 bool check_result) { | 811 bool check_result) { |
| 811 owner_is_verified_ = owner_check_finished; | 812 owner_is_verified_ = owner_check_finished; |
| 812 user_can_login_ = check_result; | 813 user_can_login_ = check_result; |
| 813 } | 814 } |
| 814 | 815 |
| 815 } // namespace chromeos | 816 } // namespace chromeos |
| OLD | NEW |