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, bool force_ephemeral) { | 349 const std::string& app_user_id, |
| 350 bool force_guest) { |
350 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 351 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
351 | 352 |
352 std::string user_id = | 353 const std::string user_id = |
353 force_ephemeral ? UserManager::kGuestUserName : app_user_id; | 354 force_guest ? UserManager::kGuestUserName : app_user_id; |
354 current_state_.reset(new AuthAttemptState( | 355 current_state_.reset(new AuthAttemptState( |
355 UserContext(user_id, | 356 UserContext(user_id, |
356 std::string(), // password | 357 std::string(), // password |
357 std::string()), // auth_code | 358 std::string()), // auth_code |
358 std::string(), // login_token | 359 std::string(), // login_token |
359 std::string(), // login_captcha | 360 std::string(), // login_captcha |
360 User::USER_TYPE_KIOSK_APP, | 361 User::USER_TYPE_KIOSK_APP, |
361 false)); | 362 false)); |
362 | 363 |
363 remove_user_data_on_failure_ = true; | 364 remove_user_data_on_failure_ = true; |
364 if (!force_ephemeral) { | 365 if (!force_guest) { |
365 MountPublic(current_state_.get(), | 366 MountPublic(current_state_.get(), |
366 scoped_refptr<ParallelAuthenticator>(this), | 367 scoped_refptr<ParallelAuthenticator>(this), |
367 cryptohome::CREATE_IF_MISSING); | 368 cryptohome::CREATE_IF_MISSING); |
368 } else { | 369 } else { |
369 ephemeral_mount_attempted_ = true; | 370 ephemeral_mount_attempted_ = true; |
370 MountGuest(current_state_.get(), | 371 MountGuest(current_state_.get(), |
371 scoped_refptr<ParallelAuthenticator>(this)); | 372 scoped_refptr<ParallelAuthenticator>(this)); |
372 } | 373 } |
373 } | 374 } |
374 | 375 |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 Resolve(); | 817 Resolve(); |
817 } | 818 } |
818 | 819 |
819 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, | 820 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, |
820 bool check_result) { | 821 bool check_result) { |
821 owner_is_verified_ = owner_check_finished; | 822 owner_is_verified_ = owner_check_finished; |
822 user_can_login_ = check_result; | 823 user_can_login_ = check_result; |
823 } | 824 } |
824 | 825 |
825 } // namespace chromeos | 826 } // namespace chromeos |
OLD | NEW |