Chromium Code Reviews| Index: chrome/browser/signin/easy_unlock_service_regular.h |
| diff --git a/chrome/browser/signin/easy_unlock_service_regular.h b/chrome/browser/signin/easy_unlock_service_regular.h |
| index 1f4ff9d605b060a5c6d5f7bcde9b2063de153511..d1febbdf34cfcb3a70a96f3fce47eb16d9edc068 100644 |
| --- a/chrome/browser/signin/easy_unlock_service_regular.h |
| +++ b/chrome/browser/signin/easy_unlock_service_regular.h |
| @@ -14,6 +14,7 @@ |
| #include "base/time/time.h" |
| #include "chrome/browser/signin/easy_unlock_service.h" |
| #include "components/proximity_auth/screenlock_bridge.h" |
| +#include "google_apis/gaia/oauth2_token_service.h" |
| #if defined(OS_CHROMEOS) |
| #include "chrome/browser/chromeos/login/easy_unlock/short_lived_user_context.h" |
| @@ -30,6 +31,9 @@ class ToggleEasyUnlockResponse; |
| namespace proximity_auth { |
| class CryptAuthClient; |
| +class CryptAuthGCMManager; |
| +class CryptAuthEnrollmentManager; |
| +class CryptAuthDeviceManager; |
| } |
| class EasyUnlockAppManager; |
| @@ -40,11 +44,20 @@ class Profile; |
| // profiles. |
| class EasyUnlockServiceRegular |
| : public EasyUnlockService, |
| - public proximity_auth::ScreenlockBridge::Observer { |
| + public proximity_auth::ScreenlockBridge::Observer, |
| + public OAuth2TokenService::Observer { |
| public: |
| explicit EasyUnlockServiceRegular(Profile* profile); |
| ~EasyUnlockServiceRegular() override; |
| + // Returns the CryptAuthEnrollmentManager, which manages the profile's |
| + // CryptAuth enrollment. |
| + proximity_auth::CryptAuthEnrollmentManager* GetCryptAuthEnrollmentManager(); |
| + |
| + // Returns the CryptAuthEnrollmentManager, which manages the profile's |
| + // synced devices from CryptAuth. |
| + proximity_auth::CryptAuthDeviceManager* GetCryptAuthDeviceManager(); |
| + |
| private: |
|
sacomoto
2015/08/27 15:38:05
Why everything is private? How is this class being
Tim Song
2015/08/27 18:12:27
These functions are publicly exposed in the base E
sacomoto
2015/08/28 14:47:17
Acknowledged.
|
| // EasyUnlockService implementation: |
| EasyUnlockService::Type GetType() const override; |
| @@ -71,6 +84,9 @@ class EasyUnlockServiceRegular |
| void OnWillFinalizeUnlock(bool success) override; |
| void OnSuspendDone() override; |
| + // OAuth2TokenService::Observer: |
| + void OnRefreshTokenAvailable(const std::string& account_id) override; |
| + |
| // proximity_auth::ScreenlockBridge::Observer implementation: |
| void OnScreenDidLock(proximity_auth::ScreenlockBridge::LockHandler::ScreenType |
| screen_type) override; |
| @@ -102,6 +118,9 @@ class EasyUnlockServiceRegular |
| EasyUnlockScreenlockStateHandler::HardlockState state_on_success, |
| bool success); |
| + // Initializes the managers that communicate with CryptAuth. |
| + void InitializeCryptAuth(); |
| + |
| scoped_ptr<chromeos::ShortLivedUserContext> short_lived_user_context_; |
| #endif |
| @@ -109,6 +128,10 @@ class EasyUnlockServiceRegular |
| // can be accessed on the sign-in screen. |
| void SyncProfilePrefsToLocalState(); |
| + // Returns the base GcmDeviceInfo proto containing the device's platform and |
| + // version information. |
| + cryptauth::GcmDeviceInfo GetGcmDeviceInfo(); |
| + |
| PrefChangeRegistrar registrar_; |
| TurnOffFlowStatus turn_off_flow_status_; |
| @@ -127,6 +150,12 @@ class EasyUnlockServiceRegular |
| // locked but the computer does not go to sleep. |
| base::TimeTicks lock_screen_last_shown_timestamp_; |
| + // Managers responsible for handling syncing and communications with |
| + // CryptAuth. |
| + scoped_ptr<proximity_auth::CryptAuthGCMManager> gcm_manager_; |
| + scoped_ptr<proximity_auth::CryptAuthEnrollmentManager> enrollment_manager_; |
| + scoped_ptr<proximity_auth::CryptAuthDeviceManager> device_manager_; |
| + |
| base::WeakPtrFactory<EasyUnlockServiceRegular> weak_ptr_factory_; |
| DISALLOW_COPY_AND_ASSIGN(EasyUnlockServiceRegular); |