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

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"
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
498 return true; 498 return true;
499 // Check if policy data is fine and continue in safe mode if needed. 499 // Check if policy data is fine and continue in safe mode if needed.
500 bool is_safe_mode = false; 500 bool is_safe_mode = false;
501 CrosSettings::Get()->GetBoolean(kPolicyMissingMitigationMode, &is_safe_mode); 501 CrosSettings::Get()->GetBoolean(kPolicyMissingMitigationMode, &is_safe_mode);
502 if (!is_safe_mode) { 502 if (!is_safe_mode) {
503 // Now we can continue with the login and report mount success. 503 // Now we can continue with the login and report mount success.
504 user_can_login_ = true; 504 user_can_login_ = true;
505 owner_is_verified_ = true; 505 owner_is_verified_ = true;
506 return true; 506 return true;
507 } 507 }
508 // Now we can continue reading the private key. 508
509 DeviceSettingsService::Get()->SetUsername(
510 current_state_->user_context.username);
511 // This should trigger certificate loading, which is needed in order to 509 // This should trigger certificate loading, which is needed in order to
512 // correctly determine if the current user is the owner. 510 // correctly determine if the current user is the owner.
513 if (LoginState::IsInitialized()) { 511 if (LoginState::IsInitialized()) {
514 LoginState::Get()->SetLoggedInState(LoginState::LOGGED_IN_SAFE_MODE, 512 LoginState::Get()->SetLoggedInState(LoginState::LOGGED_IN_SAFE_MODE,
515 LoginState::LOGGED_IN_USER_NONE); 513 LoginState::LOGGED_IN_USER_NONE);
516 } 514 }
517 DeviceSettingsService::Get()->IsCurrentUserOwnerAsync( 515 DeviceSettingsService::Get()->IsCurrentUserOwnerAsync(
518 base::Bind(&ParallelAuthenticator::OnOwnershipChecked, this)); 516 base::Bind(&ParallelAuthenticator::OnOwnershipChecked, this));
519 return false; 517 return false;
520 } 518 }
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 Resolve(); 833 Resolve();
836 } 834 }
837 835
838 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, 836 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished,
839 bool check_result) { 837 bool check_result) {
840 owner_is_verified_ = owner_check_finished; 838 owner_is_verified_ = owner_check_finished;
841 user_can_login_ = check_result; 839 user_can_login_ = check_result;
842 } 840 }
843 841
844 } // namespace chromeos 842 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698