| 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 "apps/app_lifetime_monitor.h" | 7 #include "apps/app_lifetime_monitor.h" |
| 8 #include "apps/app_lifetime_monitor_factory.h" | 8 #include "apps/app_lifetime_monitor_factory.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 | 49 |
| 50 #if defined(OS_CHROMEOS) | 50 #if defined(OS_CHROMEOS) |
| 51 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" | 51 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" |
| 52 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.
h" | 52 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager.
h" |
| 53 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager_
factory.h" | 53 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_tpm_key_manager_
factory.h" |
| 54 #include "chrome/browser/chromeos/login/easy_unlock/secure_message_delegate_chro
meos.h" | 54 #include "chrome/browser/chromeos/login/easy_unlock/secure_message_delegate_chro
meos.h" |
| 55 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 55 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 56 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 56 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 57 #include "chromeos/dbus/dbus_thread_manager.h" | 57 #include "chromeos/dbus/dbus_thread_manager.h" |
| 58 #include "chromeos/dbus/power_manager_client.h" | 58 #include "chromeos/dbus/power_manager_client.h" |
| 59 #include "components/signin/core/account_id/account_id.h" | |
| 60 #include "components/user_manager/user_manager.h" | 59 #include "components/user_manager/user_manager.h" |
| 61 #endif | 60 #endif |
| 62 | 61 |
| 63 #if defined(OS_WIN) | 62 #if defined(OS_WIN) |
| 64 #include "base/win/windows_version.h" | 63 #include "base/win/windows_version.h" |
| 65 #endif | 64 #endif |
| 66 | 65 |
| 67 using proximity_auth::ScreenlockState; | 66 using proximity_auth::ScreenlockState; |
| 68 | 67 |
| 69 namespace { | 68 namespace { |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 606 if (GetHardlockState() == EasyUnlockScreenlockStateHandler::PAIRING_CHANGED || | 605 if (GetHardlockState() == EasyUnlockScreenlockStateHandler::PAIRING_CHANGED || |
| 607 GetHardlockState() == EasyUnlockScreenlockStateHandler::PAIRING_ADDED) { | 606 GetHardlockState() == EasyUnlockScreenlockStateHandler::PAIRING_ADDED) { |
| 608 return; | 607 return; |
| 609 } | 608 } |
| 610 | 609 |
| 611 chromeos::EasyUnlockKeyManager* key_manager = | 610 chromeos::EasyUnlockKeyManager* key_manager = |
| 612 chromeos::UserSessionManager::GetInstance()->GetEasyUnlockKeyManager(); | 611 chromeos::UserSessionManager::GetInstance()->GetEasyUnlockKeyManager(); |
| 613 DCHECK(key_manager); | 612 DCHECK(key_manager); |
| 614 | 613 |
| 615 key_manager->GetDeviceDataList( | 614 key_manager->GetDeviceDataList( |
| 616 chromeos::UserContext(AccountId::FromUserEmail(user_id)), | 615 chromeos::UserContext(user_id), |
| 617 base::Bind(&EasyUnlockService::OnCryptohomeKeysFetchedForChecking, | 616 base::Bind(&EasyUnlockService::OnCryptohomeKeysFetchedForChecking, |
| 618 weak_ptr_factory_.GetWeakPtr(), user_id, paired_devices)); | 617 weak_ptr_factory_.GetWeakPtr(), |
| 618 user_id, |
| 619 paired_devices)); |
| 619 #endif | 620 #endif |
| 620 } | 621 } |
| 621 | 622 |
| 622 void EasyUnlockService::SetTrialRun() { | 623 void EasyUnlockService::SetTrialRun() { |
| 623 DCHECK_EQ(GetType(), TYPE_REGULAR); | 624 DCHECK_EQ(GetType(), TYPE_REGULAR); |
| 624 | 625 |
| 625 EasyUnlockScreenlockStateHandler* handler = GetScreenlockStateHandler(); | 626 EasyUnlockScreenlockStateHandler* handler = GetScreenlockStateHandler(); |
| 626 if (handler) | 627 if (handler) |
| 627 handler->SetTrialRun(); | 628 handler->SetTrialRun(); |
| 628 } | 629 } |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 907 | 908 |
| 908 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt | 909 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt |
| 909 // failed. | 910 // failed. |
| 910 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) | 911 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) |
| 911 ->PrepareTpmKey(true /* check_private_key */, | 912 ->PrepareTpmKey(true /* check_private_key */, |
| 912 base::Closure()); | 913 base::Closure()); |
| 913 #endif // defined(OS_CHROMEOS) | 914 #endif // defined(OS_CHROMEOS) |
| 914 | 915 |
| 915 tpm_key_checked_ = true; | 916 tpm_key_checked_ = true; |
| 916 } | 917 } |
| OLD | NEW |