Chromium Code Reviews| 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 22 matching lines...) Expand all Loading... | |
| 33 #include "components/pref_registry/pref_registry_syncable.h" | 33 #include "components/pref_registry/pref_registry_syncable.h" |
| 34 #include "components/proximity_auth/cryptauth/cryptauth_client_impl.h" | 34 #include "components/proximity_auth/cryptauth/cryptauth_client_impl.h" |
| 35 #include "components/proximity_auth/cryptauth/cryptauth_device_manager.h" | 35 #include "components/proximity_auth/cryptauth/cryptauth_device_manager.h" |
| 36 #include "components/proximity_auth/cryptauth/cryptauth_enrollment_manager.h" | 36 #include "components/proximity_auth/cryptauth/cryptauth_enrollment_manager.h" |
| 37 #include "components/proximity_auth/cryptauth/secure_message_delegate.h" | 37 #include "components/proximity_auth/cryptauth/secure_message_delegate.h" |
| 38 #include "components/proximity_auth/logging/logging.h" | 38 #include "components/proximity_auth/logging/logging.h" |
| 39 #include "components/proximity_auth/proximity_auth_pref_manager.h" | 39 #include "components/proximity_auth/proximity_auth_pref_manager.h" |
| 40 #include "components/proximity_auth/proximity_auth_system.h" | 40 #include "components/proximity_auth/proximity_auth_system.h" |
| 41 #include "components/proximity_auth/screenlock_bridge.h" | 41 #include "components/proximity_auth/screenlock_bridge.h" |
| 42 #include "components/proximity_auth/switches.h" | 42 #include "components/proximity_auth/switches.h" |
| 43 #include "components/signin/core/account_id/account_id.h" | |
| 43 #include "components/signin/core/browser/profile_oauth2_token_service.h" | 44 #include "components/signin/core/browser/profile_oauth2_token_service.h" |
| 44 #include "components/signin/core/browser/signin_manager.h" | 45 #include "components/signin/core/browser/signin_manager.h" |
| 45 #include "components/user_manager/user.h" | 46 #include "components/user_manager/user.h" |
| 46 #include "components/version_info/version_info.h" | 47 #include "components/version_info/version_info.h" |
| 47 #include "device/bluetooth/bluetooth_adapter.h" | 48 #include "device/bluetooth/bluetooth_adapter.h" |
| 48 #include "device/bluetooth/bluetooth_adapter_factory.h" | 49 #include "device/bluetooth/bluetooth_adapter_factory.h" |
| 49 | 50 |
| 50 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
| 51 #include "chrome/browser/chromeos/login/easy_unlock/easy_unlock_key_manager.h" | 52 #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" | 53 #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" | 54 #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" | 55 #include "chrome/browser/chromeos/login/easy_unlock/secure_message_delegate_chro meos.h" |
| 55 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 56 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 56 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 57 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 57 #include "chromeos/dbus/dbus_thread_manager.h" | 58 #include "chromeos/dbus/dbus_thread_manager.h" |
| 58 #include "chromeos/dbus/power_manager_client.h" | 59 #include "chromeos/dbus/power_manager_client.h" |
| 60 #include "components/signin/core/account_id/account_id.h" | |
|
achuithb
2015/10/23 00:08:51
why twice?
Alexander Alekseev
2015/10/23 09:11:23
Actually only this one is needed.
Done.
| |
| 59 #include "components/user_manager/user_manager.h" | 61 #include "components/user_manager/user_manager.h" |
| 60 #endif | 62 #endif |
| 61 | 63 |
| 62 #if defined(OS_WIN) | 64 #if defined(OS_WIN) |
| 63 #include "base/win/windows_version.h" | 65 #include "base/win/windows_version.h" |
| 64 #endif | 66 #endif |
| 65 | 67 |
| 66 using proximity_auth::ScreenlockState; | 68 using proximity_auth::ScreenlockState; |
| 67 | 69 |
| 68 namespace { | 70 namespace { |
| (...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 605 if (GetHardlockState() == EasyUnlockScreenlockStateHandler::PAIRING_CHANGED || | 607 if (GetHardlockState() == EasyUnlockScreenlockStateHandler::PAIRING_CHANGED || |
| 606 GetHardlockState() == EasyUnlockScreenlockStateHandler::PAIRING_ADDED) { | 608 GetHardlockState() == EasyUnlockScreenlockStateHandler::PAIRING_ADDED) { |
| 607 return; | 609 return; |
| 608 } | 610 } |
| 609 | 611 |
| 610 chromeos::EasyUnlockKeyManager* key_manager = | 612 chromeos::EasyUnlockKeyManager* key_manager = |
| 611 chromeos::UserSessionManager::GetInstance()->GetEasyUnlockKeyManager(); | 613 chromeos::UserSessionManager::GetInstance()->GetEasyUnlockKeyManager(); |
| 612 DCHECK(key_manager); | 614 DCHECK(key_manager); |
| 613 | 615 |
| 614 key_manager->GetDeviceDataList( | 616 key_manager->GetDeviceDataList( |
| 615 chromeos::UserContext(user_id), | 617 chromeos::UserContext(AccountId::FromUserEmail(user_id)), |
| 616 base::Bind(&EasyUnlockService::OnCryptohomeKeysFetchedForChecking, | 618 base::Bind(&EasyUnlockService::OnCryptohomeKeysFetchedForChecking, |
| 617 weak_ptr_factory_.GetWeakPtr(), | 619 weak_ptr_factory_.GetWeakPtr(), user_id, paired_devices)); |
| 618 user_id, | |
| 619 paired_devices)); | |
| 620 #endif | 620 #endif |
| 621 } | 621 } |
| 622 | 622 |
| 623 void EasyUnlockService::SetTrialRun() { | 623 void EasyUnlockService::SetTrialRun() { |
| 624 DCHECK_EQ(GetType(), TYPE_REGULAR); | 624 DCHECK_EQ(GetType(), TYPE_REGULAR); |
| 625 | 625 |
| 626 EasyUnlockScreenlockStateHandler* handler = GetScreenlockStateHandler(); | 626 EasyUnlockScreenlockStateHandler* handler = GetScreenlockStateHandler(); |
| 627 if (handler) | 627 if (handler) |
| 628 handler->SetTrialRun(); | 628 handler->SetTrialRun(); |
| 629 } | 629 } |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 906 | 906 |
| 907 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt | 907 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt |
| 908 // failed. | 908 // failed. |
| 909 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) | 909 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) |
| 910 ->PrepareTpmKey(true /* check_private_key */, | 910 ->PrepareTpmKey(true /* check_private_key */, |
| 911 base::Closure()); | 911 base::Closure()); |
| 912 #endif // defined(OS_CHROMEOS) | 912 #endif // defined(OS_CHROMEOS) |
| 913 | 913 |
| 914 tpm_key_checked_ = true; | 914 tpm_key_checked_ = true; |
| 915 } | 915 } |
| OLD | NEW |