| 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_regular.h" | 5 #include "chrome/browser/signin/easy_unlock_service_regular.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 void EasyUnlockServiceRegular::SetAutoPairingResult( | 436 void EasyUnlockServiceRegular::SetAutoPairingResult( |
| 437 bool success, | 437 bool success, |
| 438 const std::string& error) { | 438 const std::string& error) { |
| 439 DCHECK(!auto_pairing_callback_.is_null()); | 439 DCHECK(!auto_pairing_callback_.is_null()); |
| 440 | 440 |
| 441 auto_pairing_callback_.Run(success, error); | 441 auto_pairing_callback_.Run(success, error); |
| 442 auto_pairing_callback_.Reset(); | 442 auto_pairing_callback_.Reset(); |
| 443 } | 443 } |
| 444 | 444 |
| 445 void EasyUnlockServiceRegular::InitializeInternal() { | 445 void EasyUnlockServiceRegular::InitializeInternal() { |
| 446 PA_LOG(INFO) << "Initializing EasyUnlockService inside the user session."; | |
| 447 proximity_auth::ScreenlockBridge::Get()->AddObserver(this); | 446 proximity_auth::ScreenlockBridge::Get()->AddObserver(this); |
| 448 registrar_.Init(profile()->GetPrefs()); | 447 registrar_.Init(profile()->GetPrefs()); |
| 449 registrar_.Add( | 448 registrar_.Add( |
| 450 prefs::kEasyUnlockAllowed, | 449 prefs::kEasyUnlockAllowed, |
| 451 base::Bind(&EasyUnlockServiceRegular::OnPrefsChanged, | 450 base::Bind(&EasyUnlockServiceRegular::OnPrefsChanged, |
| 452 base::Unretained(this))); | 451 base::Unretained(this))); |
| 453 registrar_.Add(prefs::kEasyUnlockProximityRequired, | 452 registrar_.Add(prefs::kEasyUnlockProximityRequired, |
| 454 base::Bind(&EasyUnlockServiceRegular::OnPrefsChanged, | 453 base::Bind(&EasyUnlockServiceRegular::OnPrefsChanged, |
| 455 base::Unretained(this))); | 454 base::Unretained(this))); |
| 456 | 455 |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 | 632 |
| 634 cryptauth::CryptAuthDeviceManager* | 633 cryptauth::CryptAuthDeviceManager* |
| 635 EasyUnlockServiceRegular::GetCryptAuthDeviceManager() { | 634 EasyUnlockServiceRegular::GetCryptAuthDeviceManager() { |
| 636 cryptauth::CryptAuthDeviceManager* manager = | 635 cryptauth::CryptAuthDeviceManager* manager = |
| 637 ChromeCryptAuthServiceFactory::GetInstance() | 636 ChromeCryptAuthServiceFactory::GetInstance() |
| 638 ->GetForBrowserContext(profile()) | 637 ->GetForBrowserContext(profile()) |
| 639 ->GetCryptAuthDeviceManager(); | 638 ->GetCryptAuthDeviceManager(); |
| 640 DCHECK(manager); | 639 DCHECK(manager); |
| 641 return manager; | 640 return manager; |
| 642 } | 641 } |
| OLD | NEW |