| OLD | NEW |
| 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/signin/easy_unlock_service.h" | 5 #include "chrome/browser/signin/easy_unlock_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "apps/app_lifetime_monitor.h" | 9 #include "apps/app_lifetime_monitor.h" |
| 10 #include "apps/app_lifetime_monitor_factory.h" | 10 #include "apps/app_lifetime_monitor_factory.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 #if defined(OS_CHROMEOS) | 54 #if defined(OS_CHROMEOS) |
| 55 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" | 55 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" |
| 56 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.
h" | 56 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.
h" |
| 57 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager_
factory.h" | 57 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager_
factory.h" |
| 58 #include "chrome/browser/chromeos/login/easy_unlock/secure_message_delegate_chro
meos.h" | 58 #include "chrome/browser/chromeos/login/easy_unlock/secure_message_delegate_chro
meos.h" |
| 59 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 59 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 60 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 60 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 61 #include "chromeos/dbus/dbus_thread_manager.h" | 61 #include "chromeos/dbus/dbus_thread_manager.h" |
| 62 #include "chromeos/dbus/power_manager_client.h" | 62 #include "chromeos/dbus/power_manager_client.h" |
| 63 #include "components/session_manager/core/session_manager.h" |
| 63 #include "components/signin/core/account_id/account_id.h" | 64 #include "components/signin/core/account_id/account_id.h" |
| 64 #include "components/user_manager/user_manager.h" | |
| 65 #endif | 65 #endif |
| 66 | 66 |
| 67 #if defined(OS_WIN) | 67 #if defined(OS_WIN) |
| 68 #include "base/win/windows_version.h" | 68 #include "base/win/windows_version.h" |
| 69 #endif | 69 #endif |
| 70 | 70 |
| 71 using proximity_auth::ScreenlockState; | 71 using proximity_auth::ScreenlockState; |
| 72 | 72 |
| 73 namespace { | 73 namespace { |
| 74 | 74 |
| (...skipping 831 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 void EasyUnlockService::EnsureTpmKeyPresentIfNeeded() { | 906 void EasyUnlockService::EnsureTpmKeyPresentIfNeeded() { |
| 907 if (tpm_key_checked_ || GetType() != TYPE_REGULAR || GetAccountId().empty() || | 907 if (tpm_key_checked_ || GetType() != TYPE_REGULAR || GetAccountId().empty() || |
| 908 GetHardlockState() == EasyUnlockScreenlockStateHandler::NO_PAIRING) { | 908 GetHardlockState() == EasyUnlockScreenlockStateHandler::NO_PAIRING) { |
| 909 return; | 909 return; |
| 910 } | 910 } |
| 911 | 911 |
| 912 #if defined(OS_CHROMEOS) | 912 #if defined(OS_CHROMEOS) |
| 913 // If this is called before the session is started, the chances are Chrome | 913 // If this is called before the session is started, the chances are Chrome |
| 914 // is restarting in order to apply user flags. Don't check TPM keys in this | 914 // is restarting in order to apply user flags. Don't check TPM keys in this |
| 915 // case. | 915 // case. |
| 916 if (!user_manager::UserManager::Get() || | 916 if (!session_manager::SessionManager::Get() || |
| 917 !user_manager::UserManager::Get()->IsSessionStarted()) | 917 !session_manager::SessionManager::Get()->IsSessionStarted()) |
| 918 return; | 918 return; |
| 919 | 919 |
| 920 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt | 920 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt |
| 921 // failed. | 921 // failed. |
| 922 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) | 922 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) |
| 923 ->PrepareTpmKey(true /* check_private_key */, | 923 ->PrepareTpmKey(true /* check_private_key */, |
| 924 base::Closure()); | 924 base::Closure()); |
| 925 #endif // defined(OS_CHROMEOS) | 925 #endif // defined(OS_CHROMEOS) |
| 926 | 926 |
| 927 tpm_key_checked_ = true; | 927 tpm_key_checked_ = true; |
| 928 } | 928 } |
| OLD | NEW |