| 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" |
| 11 #include "base/guid.h" | 11 #include "base/guid.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/metrics/histogram_macros.h" | 13 #include "base/metrics/histogram_macros.h" |
| 14 #include "base/prefs/pref_registry_simple.h" | 14 #include "base/prefs/pref_registry_simple.h" |
| 15 #include "base/prefs/pref_service.h" | 15 #include "base/prefs/pref_service.h" |
| 16 #include "base/prefs/scoped_user_pref_update.h" | 16 #include "base/prefs/scoped_user_pref_update.h" |
| 17 #include "base/sys_info.h" | 17 #include "base/sys_info.h" |
| 18 #include "base/thread_task_runner_handle.h" | 18 #include "base/thread_task_runner_handle.h" |
| 19 #include "base/time/time.h" | 19 #include "base/time/time.h" |
| 20 #include "base/values.h" | 20 #include "base/values.h" |
| 21 #include "base/version.h" | 21 #include "base/version.h" |
| 22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/signin/chrome_proximity_auth_client.h" |
| 25 #include "chrome/browser/signin/chrome_proximity_auth_client_factory.h" |
| 24 #include "chrome/browser/signin/easy_unlock_app_manager.h" | 26 #include "chrome/browser/signin/easy_unlock_app_manager.h" |
| 25 #include "chrome/browser/signin/easy_unlock_service_factory.h" | 27 #include "chrome/browser/signin/easy_unlock_service_factory.h" |
| 26 #include "chrome/browser/signin/easy_unlock_service_observer.h" | 28 #include "chrome/browser/signin/easy_unlock_service_observer.h" |
| 27 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 29 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
| 28 #include "chrome/browser/signin/proximity_auth_facade.h" | 30 #include "chrome/browser/signin/proximity_auth_facade.h" |
| 29 #include "chrome/browser/signin/signin_manager_factory.h" | 31 #include "chrome/browser/signin/signin_manager_factory.h" |
| 30 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
| 31 #include "chrome/common/chrome_version_info.h" | 33 #include "chrome/common/chrome_version_info.h" |
| 32 #include "chrome/common/extensions/extension_constants.h" | 34 #include "chrome/common/extensions/extension_constants.h" |
| 33 #include "chrome/common/pref_names.h" | 35 #include "chrome/common/pref_names.h" |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 EnsureTpmKeyPresentIfNeeded(); | 689 EnsureTpmKeyPresentIfNeeded(); |
| 688 app_manager_->LoadApp(); | 690 app_manager_->LoadApp(); |
| 689 NotifyUserUpdated(); | 691 NotifyUserUpdated(); |
| 690 | 692 |
| 691 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 693 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 692 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery) && | 694 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery) && |
| 693 GetType() == EasyUnlockService::TYPE_REGULAR && | 695 GetType() == EasyUnlockService::TYPE_REGULAR && |
| 694 !proximity_auth_ble_system_) { | 696 !proximity_auth_ble_system_) { |
| 695 proximity_auth_ble_system_.reset( | 697 proximity_auth_ble_system_.reset( |
| 696 new proximity_auth::ProximityAuthBleSystem( | 698 new proximity_auth::ProximityAuthBleSystem( |
| 697 GetScreenlockBridgeInstance(), profile_, | 699 GetScreenlockBridgeInstance(), |
| 700 ChromeProximityAuthClientFactory::GetForProfile(profile_), |
| 698 CreateCryptAuthClientFactory())); | 701 CreateCryptAuthClientFactory())); |
| 699 } | 702 } |
| 700 | 703 |
| 701 #if defined(OS_CHROMEOS) | 704 #if defined(OS_CHROMEOS) |
| 702 if (!power_monitor_) | 705 if (!power_monitor_) |
| 703 power_monitor_.reset(new PowerMonitor(this)); | 706 power_monitor_.reset(new PowerMonitor(this)); |
| 704 #endif | 707 #endif |
| 705 } else { | 708 } else { |
| 706 bool bluetooth_waking_up = false; | 709 bool bluetooth_waking_up = false; |
| 707 #if defined(OS_CHROMEOS) | 710 #if defined(OS_CHROMEOS) |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 | 912 |
| 910 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt | 913 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt |
| 911 // failed. | 914 // failed. |
| 912 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) | 915 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) |
| 913 ->PrepareTpmKey(true /* check_private_key */, | 916 ->PrepareTpmKey(true /* check_private_key */, |
| 914 base::Closure()); | 917 base::Closure()); |
| 915 #endif // defined(OS_CHROMEOS) | 918 #endif // defined(OS_CHROMEOS) |
| 916 | 919 |
| 917 tpm_key_checked_ = true; | 920 tpm_key_checked_ = true; |
| 918 } | 921 } |
| OLD | NEW |