Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(604)

Side by Side Diff: chrome/browser/chromeos/login/auth/parallel_authenticator.cc

Issue 378513005: [Athena] Extract Chrome OS authentication stack (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix includes in one more test Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/auth/parallel_authenticator.h" 5 #include "chrome/browser/chromeos/login/auth/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"
11 #include "chrome/browser/chrome_notification_types.h" 11 #include "chrome/browser/chrome_notification_types.h"
12 #include "chrome/browser/chromeos/boot_times_loader.h" 12 #include "chrome/browser/chromeos/boot_times_loader.h"
13 #include "chrome/browser/chromeos/login/auth/authentication_notification_details .h" 13 #include "chrome/browser/chromeos/login/auth/authentication_notification_details .h"
14 #include "chrome/browser/chromeos/login/auth/key.h"
15 #include "chrome/browser/chromeos/login/auth/login_status_consumer.h" 14 #include "chrome/browser/chromeos/login/auth/login_status_consumer.h"
16 #include "chrome/browser/chromeos/login/auth/user_context.h"
17 #include "chrome/browser/chromeos/login/users/user_manager.h" 15 #include "chrome/browser/chromeos/login/users/user_manager.h"
18 #include "chrome/browser/chromeos/ownership/owner_settings_service.h" 16 #include "chrome/browser/chromeos/ownership/owner_settings_service.h"
19 #include "chrome/browser/chromeos/ownership/owner_settings_service_factory.h" 17 #include "chrome/browser/chromeos/ownership/owner_settings_service_factory.h"
20 #include "chrome/browser/chromeos/settings/cros_settings.h" 18 #include "chrome/browser/chromeos/settings/cros_settings.h"
21 #include "chrome/common/chrome_switches.h" 19 #include "chrome/common/chrome_switches.h"
22 #include "chromeos/cryptohome/async_method_caller.h" 20 #include "chromeos/cryptohome/async_method_caller.h"
23 #include "chromeos/cryptohome/system_salt_getter.h" 21 #include "chromeos/cryptohome/system_salt_getter.h"
24 #include "chromeos/dbus/cryptohome_client.h" 22 #include "chromeos/dbus/cryptohome_client.h"
25 #include "chromeos/dbus/dbus_thread_manager.h" 23 #include "chromeos/dbus/dbus_thread_manager.h"
24 #include "chromeos/login/auth/key.h"
25 #include "chromeos/login/auth/user_context.h"
26 #include "chromeos/login/login_state.h" 26 #include "chromeos/login/login_state.h"
27 #include "chromeos/login/user_names.h"
27 #include "components/user_manager/user_type.h" 28 #include "components/user_manager/user_type.h"
28 #include "content/public/browser/browser_thread.h" 29 #include "content/public/browser/browser_thread.h"
29 #include "content/public/browser/notification_service.h" 30 #include "content/public/browser/notification_service.h"
30 #include "third_party/cros_system_api/dbus/service_constants.h" 31 #include "third_party/cros_system_api/dbus/service_constants.h"
31 32
32 using content::BrowserThread; 33 using content::BrowserThread;
33 34
34 namespace chromeos { 35 namespace chromeos {
35 36
36 namespace { 37 namespace {
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 current_state_.get(), 316 current_state_.get(),
316 scoped_refptr<ParallelAuthenticator>(this), 317 scoped_refptr<ParallelAuthenticator>(this),
317 cryptohome::MOUNT_FLAGS_NONE)); 318 cryptohome::MOUNT_FLAGS_NONE));
318 } 319 }
319 320
320 void ParallelAuthenticator::LoginRetailMode() { 321 void ParallelAuthenticator::LoginRetailMode() {
321 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 322 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
322 // Note: |kRetailModeUserEMail| is used in other places to identify a retail 323 // Note: |kRetailModeUserEMail| is used in other places to identify a retail
323 // mode session. 324 // mode session.
324 current_state_.reset( 325 current_state_.reset(
325 new AuthAttemptState(UserContext(UserManager::kRetailModeUserName), 326 new AuthAttemptState(UserContext(chromeos::login::kRetailModeUserName),
326 user_manager::USER_TYPE_RETAIL_MODE, 327 user_manager::USER_TYPE_RETAIL_MODE,
327 false, // unlock 328 false, // unlock
328 false, // online_complete 329 false, // online_complete
329 false)); // user_is_new 330 false)); // user_is_new
330 remove_user_data_on_failure_ = false; 331 remove_user_data_on_failure_ = false;
331 ephemeral_mount_attempted_ = true; 332 ephemeral_mount_attempted_ = true;
332 MountGuestAndGetHash(current_state_.get(), 333 MountGuestAndGetHash(current_state_.get(),
333 scoped_refptr<ParallelAuthenticator>(this)); 334 scoped_refptr<ParallelAuthenticator>(this));
334 } 335 }
335 336
336 void ParallelAuthenticator::LoginOffTheRecord() { 337 void ParallelAuthenticator::LoginOffTheRecord() {
337 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 338 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
338 current_state_.reset( 339 current_state_.reset(
339 new AuthAttemptState(UserContext(UserManager::kGuestUserName), 340 new AuthAttemptState(UserContext(chromeos::login::kGuestUserName),
340 user_manager::USER_TYPE_GUEST, 341 user_manager::USER_TYPE_GUEST,
341 false, // unlock 342 false, // unlock
342 false, // online_complete 343 false, // online_complete
343 false)); // user_is_new 344 false)); // user_is_new
344 remove_user_data_on_failure_ = false; 345 remove_user_data_on_failure_ = false;
345 ephemeral_mount_attempted_ = true; 346 ephemeral_mount_attempted_ = true;
346 MountGuest(current_state_.get(), 347 MountGuest(current_state_.get(),
347 scoped_refptr<ParallelAuthenticator>(this)); 348 scoped_refptr<ParallelAuthenticator>(this));
348 } 349 }
349 350
(...skipping 13 matching lines...) Expand all
363 scoped_refptr<ParallelAuthenticator>(this), 364 scoped_refptr<ParallelAuthenticator>(this),
364 cryptohome::CREATE_IF_MISSING | cryptohome::ENSURE_EPHEMERAL)); 365 cryptohome::CREATE_IF_MISSING | cryptohome::ENSURE_EPHEMERAL));
365 } 366 }
366 367
367 void ParallelAuthenticator::LoginAsKioskAccount( 368 void ParallelAuthenticator::LoginAsKioskAccount(
368 const std::string& app_user_id, 369 const std::string& app_user_id,
369 bool use_guest_mount) { 370 bool use_guest_mount) {
370 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 371 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
371 372
372 const std::string user_id = 373 const std::string user_id =
373 use_guest_mount ? UserManager::kGuestUserName : app_user_id; 374 use_guest_mount ? chromeos::login::kGuestUserName : app_user_id;
374 current_state_.reset(new AuthAttemptState(UserContext(user_id), 375 current_state_.reset(new AuthAttemptState(UserContext(user_id),
375 user_manager::USER_TYPE_KIOSK_APP, 376 user_manager::USER_TYPE_KIOSK_APP,
376 false, // unlock 377 false, // unlock
377 false, // online_complete 378 false, // online_complete
378 false)); // user_is_new 379 false)); // user_is_new
379 380
380 remove_user_data_on_failure_ = true; 381 remove_user_data_on_failure_ = true;
381 if (!use_guest_mount) { 382 if (!use_guest_mount) {
382 MountPublic(current_state_.get(), 383 MountPublic(current_state_.get(),
383 scoped_refptr<ParallelAuthenticator>(this), 384 scoped_refptr<ParallelAuthenticator>(this),
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after
814 Resolve(); 815 Resolve();
815 } 816 }
816 817
817 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, 818 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished,
818 bool check_result) { 819 bool check_result) {
819 owner_is_verified_ = owner_check_finished; 820 owner_is_verified_ = owner_check_finished;
820 user_can_login_ = check_result; 821 user_can_login_ = check_result;
821 } 822 }
822 823
823 } // namespace chromeos 824 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698