Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2774)

Unified Diff: chrome/browser/signin/easy_unlock_service_regular.h

Issue 1308393007: Add CryptAuth managers to EasyUnlockServiceRegular (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix windows compile Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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:
// 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);
« no previous file with comments | « chrome/browser/signin/chrome_proximity_auth_client.cc ('k') | chrome/browser/signin/easy_unlock_service_regular.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698