| 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/services/gcm/gcm_profile_service.h" |
| 25 #include "chrome/browser/services/gcm/gcm_profile_service_factory.h" |
| 24 #include "chrome/browser/signin/chrome_proximity_auth_client.h" | 26 #include "chrome/browser/signin/chrome_proximity_auth_client.h" |
| 25 #include "chrome/browser/signin/easy_unlock_app_manager.h" | 27 #include "chrome/browser/signin/easy_unlock_app_manager.h" |
| 26 #include "chrome/browser/signin/easy_unlock_service_factory.h" | 28 #include "chrome/browser/signin/easy_unlock_service_factory.h" |
| 27 #include "chrome/browser/signin/easy_unlock_service_observer.h" | 29 #include "chrome/browser/signin/easy_unlock_service_observer.h" |
| 28 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 30 #include "chrome/browser/signin/profile_oauth2_token_service_factory.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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 chrome::VersionInfo version_info; | 680 chrome::VersionInfo version_info; |
| 679 const std::vector<uint32_t>& version_components = | 681 const std::vector<uint32_t>& version_components = |
| 680 base::Version(version_info.Version()).components(); | 682 base::Version(version_info.Version()).components(); |
| 681 if (version_components.size() > 0) | 683 if (version_components.size() > 0) |
| 682 device_classifier.set_device_software_version_code(version_components[0]); | 684 device_classifier.set_device_software_version_code(version_components[0]); |
| 683 | 685 |
| 684 device_classifier.set_device_software_package(version_info.Name()); | 686 device_classifier.set_device_software_package(version_info.Name()); |
| 685 return device_classifier; | 687 return device_classifier; |
| 686 } | 688 } |
| 687 | 689 |
| 690 gcm::GCMDriver* EasyUnlockService::GetGCMDriver() { |
| 691 gcm::GCMProfileService* gcm_profile_service = |
| 692 gcm::GCMProfileServiceFactory::GetForProfile(profile_); |
| 693 return gcm_profile_service->driver(); |
| 694 } |
| 695 |
| 688 void EasyUnlockService::Shutdown() { | 696 void EasyUnlockService::Shutdown() { |
| 689 if (shut_down_) | 697 if (shut_down_) |
| 690 return; | 698 return; |
| 691 shut_down_ = true; | 699 shut_down_ = true; |
| 692 | 700 |
| 693 ShutdownInternal(); | 701 ShutdownInternal(); |
| 694 | 702 |
| 695 ResetScreenlockState(); | 703 ResetScreenlockState(); |
| 696 bluetooth_detector_.reset(); | 704 bluetooth_detector_.reset(); |
| 697 #if defined(OS_CHROMEOS) | 705 #if defined(OS_CHROMEOS) |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 | 943 |
| 936 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt | 944 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt |
| 937 // failed. | 945 // failed. |
| 938 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) | 946 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) |
| 939 ->PrepareTpmKey(true /* check_private_key */, | 947 ->PrepareTpmKey(true /* check_private_key */, |
| 940 base::Closure()); | 948 base::Closure()); |
| 941 #endif // defined(OS_CHROMEOS) | 949 #endif // defined(OS_CHROMEOS) |
| 942 | 950 |
| 943 tpm_key_checked_ = true; | 951 tpm_key_checked_ = true; |
| 944 } | 952 } |
| OLD | NEW |