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 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 user_prefs::PrefRegistrySyncable* registry) { | 281 user_prefs::PrefRegistrySyncable* registry) { |
282 registry->RegisterBooleanPref(prefs::kEasyUnlockAllowed, true); | 282 registry->RegisterBooleanPref(prefs::kEasyUnlockAllowed, true); |
283 registry->RegisterBooleanPref(prefs::kEasyUnlockEnabled, false); | 283 registry->RegisterBooleanPref(prefs::kEasyUnlockEnabled, false); |
284 registry->RegisterDictionaryPref(prefs::kEasyUnlockPairing, | 284 registry->RegisterDictionaryPref(prefs::kEasyUnlockPairing, |
285 new base::DictionaryValue()); | 285 new base::DictionaryValue()); |
286 registry->RegisterBooleanPref( | 286 registry->RegisterBooleanPref( |
287 prefs::kEasyUnlockProximityRequired, | 287 prefs::kEasyUnlockProximityRequired, |
288 false, | 288 false, |
289 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 289 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
290 | 290 |
| 291 proximity_auth::CryptAuthGCMManager::RegisterPrefs(registry); |
291 proximity_auth::CryptAuthDeviceManager::RegisterPrefs(registry); | 292 proximity_auth::CryptAuthDeviceManager::RegisterPrefs(registry); |
292 proximity_auth::CryptAuthEnrollmentManager::RegisterPrefs(registry); | 293 proximity_auth::CryptAuthEnrollmentManager::RegisterPrefs(registry); |
293 | 294 |
294 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 295 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
295 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery)) | 296 proximity_auth::switches::kEnableBluetoothLowEnergyDiscovery)) |
296 proximity_auth::ProximityAuthBleSystem::RegisterPrefs(registry); | 297 proximity_auth::ProximityAuthBleSystem::RegisterPrefs(registry); |
297 } | 298 } |
298 | 299 |
299 // static | 300 // static |
300 void EasyUnlockService::RegisterPrefs(PrefRegistrySimple* registry) { | 301 void EasyUnlockService::RegisterPrefs(PrefRegistrySimple* registry) { |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 chrome::VersionInfo version_info; | 681 chrome::VersionInfo version_info; |
681 const std::vector<uint32_t>& version_components = | 682 const std::vector<uint32_t>& version_components = |
682 base::Version(version_info.Version()).components(); | 683 base::Version(version_info.Version()).components(); |
683 if (version_components.size() > 0) | 684 if (version_components.size() > 0) |
684 device_classifier.set_device_software_version_code(version_components[0]); | 685 device_classifier.set_device_software_version_code(version_components[0]); |
685 | 686 |
686 device_classifier.set_device_software_package(version_info.Name()); | 687 device_classifier.set_device_software_package(version_info.Name()); |
687 return device_classifier; | 688 return device_classifier; |
688 } | 689 } |
689 | 690 |
| 691 std::string EasyUnlockService::GetAccountId() { |
| 692 return SigninManagerFactory::GetForProfile(profile()) |
| 693 ->GetAuthenticatedAccountId(); |
| 694 } |
| 695 |
690 gcm::GCMDriver* EasyUnlockService::GetGCMDriver() { | 696 gcm::GCMDriver* EasyUnlockService::GetGCMDriver() { |
691 gcm::GCMProfileService* gcm_profile_service = | 697 gcm::GCMProfileService* gcm_profile_service = |
692 gcm::GCMProfileServiceFactory::GetForProfile(profile_); | 698 gcm::GCMProfileServiceFactory::GetForProfile(profile_); |
693 return gcm_profile_service->driver(); | 699 return gcm_profile_service->driver(); |
694 } | 700 } |
695 | 701 |
696 void EasyUnlockService::Shutdown() { | 702 void EasyUnlockService::Shutdown() { |
697 if (shut_down_) | 703 if (shut_down_) |
698 return; | 704 return; |
699 shut_down_ = true; | 705 shut_down_ = true; |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 | 949 |
944 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt | 950 // TODO(tbarzic): Set check_private_key only if previous sign-in attempt |
945 // failed. | 951 // failed. |
946 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) | 952 EasyUnlockTpmKeyManagerFactory::GetInstance()->Get(profile_) |
947 ->PrepareTpmKey(true /* check_private_key */, | 953 ->PrepareTpmKey(true /* check_private_key */, |
948 base::Closure()); | 954 base::Closure()); |
949 #endif // defined(OS_CHROMEOS) | 955 #endif // defined(OS_CHROMEOS) |
950 | 956 |
951 tpm_key_checked_ = true; | 957 tpm_key_checked_ = true; |
952 } | 958 } |
OLD | NEW |