| 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 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 } | 633 } |
| 634 | 634 |
| 635 void EasyUnlockService::UpdateAppState() { | 635 void EasyUnlockService::UpdateAppState() { |
| 636 if (IsAllowed()) { | 636 if (IsAllowed()) { |
| 637 EnsureTpmKeyPresentIfNeeded(); | 637 EnsureTpmKeyPresentIfNeeded(); |
| 638 app_manager_->LoadApp(); | 638 app_manager_->LoadApp(); |
| 639 NotifyUserUpdated(); | 639 NotifyUserUpdated(); |
| 640 | 640 |
| 641 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 641 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 642 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery) && | 642 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery) && |
| 643 GetType() == EasyUnlockService::TYPE_REGULAR && |
| 643 !proximity_auth_ble_system_) { | 644 !proximity_auth_ble_system_) { |
| 644 proximity_auth_ble_system_.reset( | 645 proximity_auth_ble_system_.reset( |
| 645 new proximity_auth::ProximityAuthBleSystem()); | 646 new proximity_auth::ProximityAuthBleSystem( |
| 647 GetScreenlockBridgeInstance(), profile_)); |
| 646 } | 648 } |
| 647 | 649 |
| 648 #if defined(OS_CHROMEOS) | 650 #if defined(OS_CHROMEOS) |
| 649 if (!power_monitor_) | 651 if (!power_monitor_) |
| 650 power_monitor_.reset(new PowerMonitor(this)); | 652 power_monitor_.reset(new PowerMonitor(this)); |
| 651 #endif | 653 #endif |
| 652 } else { | 654 } else { |
| 653 bool bluetooth_waking_up = false; | 655 bool bluetooth_waking_up = false; |
| 654 #if defined(OS_CHROMEOS) | 656 #if defined(OS_CHROMEOS) |
| 655 // If the service is not allowed due to bluetooth not being detected just | 657 // If the service is not allowed due to bluetooth not being detected just |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 | 861 |
| 860 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt | 862 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt |
| 861 // failed. | 863 // failed. |
| 862 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) | 864 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) |
| 863 ->PrepareTpmKey(true /* check_private_key */, | 865 ->PrepareTpmKey(true /* check_private_key */, |
| 864 base::Closure()); | 866 base::Closure()); |
| 865 #endif // defined(OS_CHROMEOS) | 867 #endif // defined(OS_CHROMEOS) |
| 866 | 868 |
| 867 tpm_key_checked_ = true; | 869 tpm_key_checked_ = true; |
| 868 } | 870 } |
| OLD | NEW |