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

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

Issue 270663002: Implemented profile-aware owner key loading. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes. Created 6 years, 7 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 (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"
11 #include "base/strings/string_number_conversions.h" 11 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "chrome/browser/chrome_notification_types.h" 13 #include "chrome/browser/chrome_notification_types.h"
14 #include "chrome/browser/chromeos/boot_times_loader.h" 14 #include "chrome/browser/chromeos/boot_times_loader.h"
15 #include "chrome/browser/chromeos/login/authentication_notification_details.h" 15 #include "chrome/browser/chromeos/login/authentication_notification_details.h"
16 #include "chrome/browser/chromeos/login/login_status_consumer.h" 16 #include "chrome/browser/chromeos/login/login_status_consumer.h"
17 #include "chrome/browser/chromeos/login/owner_settings_service_factory.h"
17 #include "chrome/browser/chromeos/login/user.h" 18 #include "chrome/browser/chromeos/login/user.h"
18 #include "chrome/browser/chromeos/login/user_manager.h" 19 #include "chrome/browser/chromeos/login/user_manager.h"
19 #include "chrome/browser/chromeos/settings/cros_settings.h" 20 #include "chrome/browser/chromeos/settings/cros_settings.h"
20 #include "chrome/common/chrome_switches.h" 21 #include "chrome/common/chrome_switches.h"
21 #include "chromeos/cryptohome/async_method_caller.h" 22 #include "chromeos/cryptohome/async_method_caller.h"
22 #include "chromeos/cryptohome/system_salt_getter.h" 23 #include "chromeos/cryptohome/system_salt_getter.h"
23 #include "chromeos/dbus/cryptohome_client.h" 24 #include "chromeos/dbus/cryptohome_client.h"
24 #include "chromeos/dbus/dbus_thread_manager.h" 25 #include "chromeos/dbus/dbus_thread_manager.h"
25 #include "chromeos/login/login_state.h" 26 #include "chromeos/login/login_state.h"
26 #include "content/public/browser/browser_thread.h" 27 #include "content/public/browser/browser_thread.h"
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 return true; 499 return true;
499 // Check if policy data is fine and continue in safe mode if needed. 500 // Check if policy data is fine and continue in safe mode if needed.
500 bool is_safe_mode = false; 501 bool is_safe_mode = false;
501 CrosSettings::Get()->GetBoolean(kPolicyMissingMitigationMode, &is_safe_mode); 502 CrosSettings::Get()->GetBoolean(kPolicyMissingMitigationMode, &is_safe_mode);
502 if (!is_safe_mode) { 503 if (!is_safe_mode) {
503 // Now we can continue with the login and report mount success. 504 // Now we can continue with the login and report mount success.
504 user_can_login_ = true; 505 user_can_login_ = true;
505 owner_is_verified_ = true; 506 owner_is_verified_ = true;
506 return true; 507 return true;
507 } 508 }
508 // Now we can continue reading the private key. 509
509 DeviceSettingsService::Get()->SetUsername( 510 OwnerSettingsServiceFactory::GetInstance()->SetUsername(
510 current_state_->user_context.username); 511 current_state_->user_context.username);
512
511 // This should trigger certificate loading, which is needed in order to 513 // This should trigger certificate loading, which is needed in order to
512 // correctly determine if the current user is the owner. 514 // correctly determine if the current user is the owner.
513 if (LoginState::IsInitialized()) { 515 if (LoginState::IsInitialized()) {
514 LoginState::Get()->SetLoggedInState(LoginState::LOGGED_IN_SAFE_MODE, 516 LoginState::Get()->SetLoggedInState(LoginState::LOGGED_IN_SAFE_MODE,
515 LoginState::LOGGED_IN_USER_NONE); 517 LoginState::LOGGED_IN_USER_NONE);
516 } 518 }
517 DeviceSettingsService::Get()->IsCurrentUserOwnerAsync( 519 DeviceSettingsService::Get()->IsCurrentUserOwnerAsync(
518 base::Bind(&ParallelAuthenticator::OnOwnershipChecked, this)); 520 base::Bind(&ParallelAuthenticator::OnOwnershipChecked, this));
519 return false; 521 return false;
520 } 522 }
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 Resolve(); 837 Resolve();
836 } 838 }
837 839
838 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, 840 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished,
839 bool check_result) { 841 bool check_result) {
840 owner_is_verified_ = owner_check_finished; 842 owner_is_verified_ = owner_check_finished;
841 user_can_login_ = check_result; 843 user_can_login_ = check_result;
842 } 844 }
843 845
844 } // namespace chromeos 846 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698