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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 bool waking_up_; | 253 bool waking_up_; |
254 base::Time wake_up_time_; | 254 base::Time wake_up_time_; |
255 base::WeakPtrFactory<PowerMonitor> weak_ptr_factory_; | 255 base::WeakPtrFactory<PowerMonitor> weak_ptr_factory_; |
256 | 256 |
257 DISALLOW_COPY_AND_ASSIGN(PowerMonitor); | 257 DISALLOW_COPY_AND_ASSIGN(PowerMonitor); |
258 }; | 258 }; |
259 #endif | 259 #endif |
260 | 260 |
261 EasyUnlockService::EasyUnlockService(Profile* profile) | 261 EasyUnlockService::EasyUnlockService(Profile* profile) |
262 : profile_(profile), | 262 : profile_(profile), |
| 263 proximity_auth_client_(profile), |
263 bluetooth_detector_(new BluetoothDetector(this)), | 264 bluetooth_detector_(new BluetoothDetector(this)), |
264 shut_down_(false), | 265 shut_down_(false), |
265 tpm_key_checked_(false), | 266 tpm_key_checked_(false), |
266 weak_ptr_factory_(this) { | 267 weak_ptr_factory_(this) { |
267 } | 268 } |
268 | 269 |
269 EasyUnlockService::~EasyUnlockService() { | 270 EasyUnlockService::~EasyUnlockService() { |
270 } | 271 } |
271 | 272 |
272 // static | 273 // static |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 EnsureTpmKeyPresentIfNeeded(); | 688 EnsureTpmKeyPresentIfNeeded(); |
688 app_manager_->LoadApp(); | 689 app_manager_->LoadApp(); |
689 NotifyUserUpdated(); | 690 NotifyUserUpdated(); |
690 | 691 |
691 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 692 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
692 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery) && | 693 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery) && |
693 GetType() == EasyUnlockService::TYPE_REGULAR && | 694 GetType() == EasyUnlockService::TYPE_REGULAR && |
694 !proximity_auth_ble_system_) { | 695 !proximity_auth_ble_system_) { |
695 proximity_auth_ble_system_.reset( | 696 proximity_auth_ble_system_.reset( |
696 new proximity_auth::ProximityAuthBleSystem( | 697 new proximity_auth::ProximityAuthBleSystem( |
697 GetScreenlockBridgeInstance(), profile_, | 698 GetScreenlockBridgeInstance(), &proximity_auth_client_, |
698 CreateCryptAuthClientFactory())); | 699 CreateCryptAuthClientFactory())); |
699 } | 700 } |
700 | 701 |
701 #if defined(OS_CHROMEOS) | 702 #if defined(OS_CHROMEOS) |
702 if (!power_monitor_) | 703 if (!power_monitor_) |
703 power_monitor_.reset(new PowerMonitor(this)); | 704 power_monitor_.reset(new PowerMonitor(this)); |
704 #endif | 705 #endif |
705 } else { | 706 } else { |
706 bool bluetooth_waking_up = false; | 707 bool bluetooth_waking_up = false; |
707 #if defined(OS_CHROMEOS) | 708 #if defined(OS_CHROMEOS) |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
909 | 910 |
910 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt | 911 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt |
911 // failed. | 912 // failed. |
912 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) | 913 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) |
913 ->PrepareTpmKey(true /* check_private_key */, | 914 ->PrepareTpmKey(true /* check_private_key */, |
914 base::Closure()); | 915 base::Closure()); |
915 #endif // defined(OS_CHROMEOS) | 916 #endif // defined(OS_CHROMEOS) |
916 | 917 |
917 tpm_key_checked_ = true; | 918 tpm_key_checked_ = true; |
918 } | 919 } |
OLD | NEW |