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

Unified Diff: chrome/browser/cryptauth/chrome_cryptauth_service.h

Issue 2911583003: ChromeCryptAuthService: only perform device sync once enrollment is complete. (Closed)
Patch Set: Always remove service as EnrollmentManager observer on enrollment finished. Created 3 years, 7 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/cryptauth/chrome_cryptauth_service.h
diff --git a/chrome/browser/cryptauth/chrome_cryptauth_service.h b/chrome/browser/cryptauth/chrome_cryptauth_service.h
index 21f8f70006b03bde22a8af41dd4ac1db991dfa12..9aa6c11e119d706b81c5d5c28b18398080c4da57 100644
--- a/chrome/browser/cryptauth/chrome_cryptauth_service.h
+++ b/chrome/browser/cryptauth/chrome_cryptauth_service.h
@@ -8,6 +8,7 @@
#include <memory>
#include "base/macros.h"
+#include "components/cryptauth/cryptauth_enrollment_manager.h"
#include "components/cryptauth/cryptauth_service.h"
#include "components/cryptauth/proto/cryptauth_api.pb.h"
#include "components/keyed_service/core/keyed_service.h"
@@ -20,9 +21,11 @@ class CryptAuthGCMManager;
} // namespace cryptauth
// Implementation of cryptauth::CryptAuthService.
-class ChromeCryptAuthService : public KeyedService,
- public cryptauth::CryptAuthService,
- public OAuth2TokenService::Observer {
+class ChromeCryptAuthService
+ : public KeyedService,
+ public cryptauth::CryptAuthService,
+ public cryptauth::CryptAuthEnrollmentManager::Observer,
+ public OAuth2TokenService::Observer {
public:
static std::unique_ptr<ChromeCryptAuthService> Create(Profile* profile);
~ChromeCryptAuthService() override;
@@ -41,6 +44,10 @@ class ChromeCryptAuthService : public KeyedService,
std::unique_ptr<cryptauth::CryptAuthClientFactory>
CreateCryptAuthClientFactory() override;
+ // cryptauth::CryptAuthEnrollmentManager::Observer:
+ void OnEnrollmentStarted() override;
+ void OnEnrollmentFinished(bool success) override;
+
protected:
// Note: ChromeCryptAuthServiceFactory DependsOn(OAuth2TokenServiceFactory),
// so |token_service| is guaranteed to outlast this service.
@@ -55,6 +62,8 @@ class ChromeCryptAuthService : public KeyedService,
// OAuth2TokenService::Observer:
void OnRefreshTokenAvailable(const std::string& account_id) override;
+ void PerformEnrollmentAndDeviceSync();
+
std::unique_ptr<cryptauth::CryptAuthGCMManager> gcm_manager_;
std::unique_ptr<cryptauth::CryptAuthEnrollmentManager> enrollment_manager_;
std::unique_ptr<cryptauth::CryptAuthDeviceManager> device_manager_;

Powered by Google App Engine
This is Rietveld 408576698