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

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

Issue 57363003: Enable account reconcilor when --new-profile-management is used. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 1 month 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/account_reconcilor.h
diff --git a/chrome/browser/signin/account_reconcilor.h b/chrome/browser/signin/account_reconcilor.h
index 7454f36e60e4152c442f952a7c113f01d2c9580b..1f9fa1360317055e26d27ef6bcb057480b04910f 100644
--- a/chrome/browser/signin/account_reconcilor.h
+++ b/chrome/browser/signin/account_reconcilor.h
@@ -6,16 +6,21 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
+#include "google_apis/gaia/gaia_auth_consumer.h"
#include "google_apis/gaia/oauth2_token_service.h"
+class GaiaAuthFetcher;
class Profile;
struct ChromeCookieDetails;
class AccountReconcilor : public BrowserContextKeyedService,
content::NotificationObserver,
+ GaiaAuthConsumer,
+ OAuth2TokenService::Consumer,
OAuth2TokenService::Observer {
public:
explicit AccountReconcilor(Profile* profile);
@@ -39,32 +44,66 @@ class AccountReconcilor : public BrowserContextKeyedService,
void RegisterWithTokenService();
void UnregisterWithTokenService();
+ bool IsProfileConnected();
+
+ void DeleteAccessTokenRequests();
+
+ std::vector<std::string> ParseListAccountsData(const std::string& data);
+
// Start and stop the periodic reconciliation.
void StartPeriodicReconciliation();
void StopPeriodicReconciliation();
void PeriodicReconciliation();
- // The profile that this reconcilor belongs to.
- Profile* profile_;
- content::NotificationRegistrar registrar_;
- base::RepeatingTimer<AccountReconcilor> reconciliation_timer_;
-
void PerformMergeAction(const std::string& account_id);
void PerformRemoveAction(const std::string& account_id);
- void PerformReconcileAction();
+ void StartReconcileAction();
+ void FinishReconcileAction();
+
+ void GetAccountsFromCookie();
+ void ValidateAccountsFromTokenService();
+
+ void OnCookieChanged(ChromeCookieDetails* details);
// Overriden from content::NotificationObserver
virtual void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) OVERRIDE;
- void OnCookieChanged(ChromeCookieDetails* details);
+ // Overriden from OAuth2TokenService::Consumer
+ virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request,
+ const std::string& access_token,
+ const base::Time& expiration_time) OVERRIDE;
+ virtual void OnGetTokenFailure(const OAuth2TokenService::Request* request,
+ const GoogleServiceAuthError& error) OVERRIDE;
// Overriden from OAuth2TokenService::Observer
virtual void OnRefreshTokenAvailable(const std::string& account_id) OVERRIDE;
virtual void OnRefreshTokenRevoked(const std::string& account_id) OVERRIDE;
virtual void OnRefreshTokensLoaded() OVERRIDE;
+ // Overriden from GaiaAuthConsumer
+ virtual void OnListAccountsSuccess(const std::string& data) OVERRIDE;
+ virtual void OnListAccountsFailure(
+ const GoogleServiceAuthError& error) OVERRIDE;
+
+ // The profile that this reconcilor belongs to.
+ Profile* profile_;
+ content::NotificationRegistrar registrar_;
+ base::RepeatingTimer<AccountReconcilor> reconciliation_timer_;
+
+ // Used during reconcile action.
+ // These members are used used to validate the gaia cookie.
+ scoped_ptr<GaiaAuthFetcher> gaia_fetcher_;
+ bool are_gaia_accounts_set_;
+ std::vector<std::string> gaia_accounts_;
acleung1 2013/11/04 21:19:00 My understanding is that we are going to eventuall
Roger Tawa OOO till Jul 10th 2013/11/04 23:38:42 These members would only be used by one thread, ev
+ // These members are used to validate the tokens in OAuth2TokenService.
acleung1 2013/11/04 21:19:00 May be a new line before this for better readabili
Roger Tawa OOO till Jul 10th 2013/11/04 23:38:42 Done.
+ std::string primary_account_;
+ std::vector<std::string> chrome_accounts_;
+ scoped_ptr<OAuth2TokenService::Request>* requests_;
+ std::set<std::string> valid_chrome_accounts_;
+ std::set<std::string> invalid_chrome_accounts_;
+
DISALLOW_COPY_AND_ASSIGN(AccountReconcilor);
};

Powered by Google App Engine
This is Rietveld 408576698