| 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 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 PA_LOG(INFO) << "Initializing CryptAuth managers."; | 654 PA_LOG(INFO) << "Initializing CryptAuth managers."; |
| 655 // Initialize GCM manager. | 655 // Initialize GCM manager. |
| 656 gcm_manager_.reset(new proximity_auth::CryptAuthGCMManagerImpl( | 656 gcm_manager_.reset(new proximity_auth::CryptAuthGCMManagerImpl( |
| 657 gcm::GCMProfileServiceFactory::GetForProfile(profile())->driver(), | 657 gcm::GCMProfileServiceFactory::GetForProfile(profile())->driver(), |
| 658 proximity_auth_client()->GetPrefService())); | 658 proximity_auth_client()->GetPrefService())); |
| 659 gcm_manager_->StartListening(); | 659 gcm_manager_->StartListening(); |
| 660 | 660 |
| 661 // Initialize enrollment manager. | 661 // Initialize enrollment manager. |
| 662 cryptauth::GcmDeviceInfo device_info; | 662 cryptauth::GcmDeviceInfo device_info; |
| 663 enrollment_manager_.reset(new proximity_auth::CryptAuthEnrollmentManager( | 663 enrollment_manager_.reset(new proximity_auth::CryptAuthEnrollmentManager( |
| 664 base::WrapUnique(new base::DefaultClock()), | 664 base::MakeUnique<base::DefaultClock>(), |
| 665 base::WrapUnique(new proximity_auth::CryptAuthEnrollerFactoryImpl( | 665 base::MakeUnique<proximity_auth::CryptAuthEnrollerFactoryImpl>( |
| 666 proximity_auth_client())), | 666 proximity_auth_client()), |
| 667 proximity_auth_client()->CreateSecureMessageDelegate(), | 667 proximity_auth_client()->CreateSecureMessageDelegate(), |
| 668 GetGcmDeviceInfo(), gcm_manager_.get(), | 668 GetGcmDeviceInfo(), gcm_manager_.get(), |
| 669 proximity_auth_client()->GetPrefService())); | 669 proximity_auth_client()->GetPrefService())); |
| 670 | 670 |
| 671 // Initialize device manager. | 671 // Initialize device manager. |
| 672 device_manager_.reset(new proximity_auth::CryptAuthDeviceManager( | 672 device_manager_.reset(new proximity_auth::CryptAuthDeviceManager( |
| 673 base::WrapUnique(new base::DefaultClock()), | 673 base::MakeUnique<base::DefaultClock>(), |
| 674 proximity_auth_client()->CreateCryptAuthClientFactory(), | 674 proximity_auth_client()->CreateCryptAuthClientFactory(), |
| 675 gcm_manager_.get(), proximity_auth_client()->GetPrefService())); | 675 gcm_manager_.get(), proximity_auth_client()->GetPrefService())); |
| 676 | 676 |
| 677 OAuth2TokenService* token_service = | 677 OAuth2TokenService* token_service = |
| 678 ProfileOAuth2TokenServiceFactory::GetForProfile(profile()); | 678 ProfileOAuth2TokenServiceFactory::GetForProfile(profile()); |
| 679 if (!token_service->RefreshTokenIsAvailable( | 679 if (!token_service->RefreshTokenIsAvailable( |
| 680 proximity_auth_client()->GetAccountId())) { | 680 proximity_auth_client()->GetAccountId())) { |
| 681 PA_LOG(INFO) << "Refresh token not yet available, " | 681 PA_LOG(INFO) << "Refresh token not yet available, " |
| 682 << "waiting before starting CryptAuth managers"; | 682 << "waiting before starting CryptAuth managers"; |
| 683 token_service->AddObserver(this); | 683 token_service->AddObserver(this); |
| 684 } | 684 } |
| 685 | 685 |
| 686 device_manager_->AddObserver(this); | 686 device_manager_->AddObserver(this); |
| 687 enrollment_manager_->Start(); | 687 enrollment_manager_->Start(); |
| 688 device_manager_->Start(); | 688 device_manager_->Start(); |
| 689 } | 689 } |
| 690 #endif | 690 #endif |
| OLD | NEW |