| 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" |
| 59 #include "components/user_manager/user_manager.h" | 60 #include "components/user_manager/user_manager.h" |
| 60 #endif | 61 #endif |
| 61 | 62 |
| 62 #if defined(OS_WIN) | 63 #if defined(OS_WIN) |
| 63 #include "base/win/windows_version.h" | 64 #include "base/win/windows_version.h" |
| 64 #endif | 65 #endif |
| 65 | 66 |
| 66 using proximity_auth::ScreenlockState; | 67 using proximity_auth::ScreenlockState; |
| 67 | 68 |
| 68 namespace { | 69 namespace { |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 if (GetHardlockState() == EasyUnlockScreenlockStateHandler::PAIRING_CHANGED || | 606 if (GetHardlockState() == EasyUnlockScreenlockStateHandler::PAIRING_CHANGED || |
| 606 GetHardlockState() == EasyUnlockScreenlockStateHandler::PAIRING_ADDED) { | 607 GetHardlockState() == EasyUnlockScreenlockStateHandler::PAIRING_ADDED) { |
| 607 return; | 608 return; |
| 608 } | 609 } |
| 609 | 610 |
| 610 chromeos::EasyUnlockKeyManager* key_manager = | 611 chromeos::EasyUnlockKeyManager* key_manager = |
| 611 chromeos::UserSessionManager::GetInstance()->GetEasyUnlockKeyManager(); | 612 chromeos::UserSessionManager::GetInstance()->GetEasyUnlockKeyManager(); |
| 612 DCHECK(key_manager); | 613 DCHECK(key_manager); |
| 613 | 614 |
| 614 key_manager->GetDeviceDataList( | 615 key_manager->GetDeviceDataList( |
| 615 chromeos::UserContext(user_id), | 616 chromeos::UserContext(AccountId::FromUserEmail(user_id)), |
| 616 base::Bind(&EasyUnlockService::OnCryptohomeKeysFetchedForChecking, | 617 base::Bind(&EasyUnlockService::OnCryptohomeKeysFetchedForChecking, |
| 617 weak_ptr_factory_.GetWeakPtr(), | 618 weak_ptr_factory_.GetWeakPtr(), user_id, paired_devices)); |
| 618 user_id, | |
| 619 paired_devices)); | |
| 620 #endif | 619 #endif |
| 621 } | 620 } |
| 622 | 621 |
| 623 void EasyUnlockService::SetTrialRun() { | 622 void EasyUnlockService::SetTrialRun() { |
| 624 DCHECK_EQ(GetType(), TYPE_REGULAR); | 623 DCHECK_EQ(GetType(), TYPE_REGULAR); |
| 625 | 624 |
| 626 EasyUnlockScreenlockStateHandler* handler = GetScreenlockStateHandler(); | 625 EasyUnlockScreenlockStateHandler* handler = GetScreenlockStateHandler(); |
| 627 if (handler) | 626 if (handler) |
| 628 handler->SetTrialRun(); | 627 handler->SetTrialRun(); |
| 629 } | 628 } |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 | 905 |
| 907 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt | 906 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt |
| 908 // failed. | 907 // failed. |
| 909 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) | 908 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) |
| 910 ->PrepareTpmKey(true /* check_private_key */, | 909 ->PrepareTpmKey(true /* check_private_key */, |
| 911 base::Closure()); | 910 base::Closure()); |
| 912 #endif // defined(OS_CHROMEOS) | 911 #endif // defined(OS_CHROMEOS) |
| 913 | 912 |
| 914 tpm_key_checked_ = true; | 913 tpm_key_checked_ = true; |
| 915 } | 914 } |
| OLD | NEW |