Chromium Code Reviews| Index: components/signin/core/browser/account_reconcilor.h |
| diff --git a/chrome/browser/signin/account_reconcilor.h b/components/signin/core/browser/account_reconcilor.h |
| similarity index 88% |
| rename from chrome/browser/signin/account_reconcilor.h |
| rename to components/signin/core/browser/account_reconcilor.h |
| index f05721c449dd991b2fa63cd91ef55cd42d09e55b..f097fffd303ae4de10c73247c145fa677271c508 100644 |
| --- a/chrome/browser/signin/account_reconcilor.h |
| +++ b/components/signin/core/browser/account_reconcilor.h |
| @@ -1,8 +1,8 @@ |
| // Copyright 2013 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#ifndef CHROME_BROWSER_SIGNIN_ACCOUNT_RECONCILOR_H_ |
| -#define CHROME_BROWSER_SIGNIN_ACCOUNT_RECONCILOR_H_ |
| +#ifndef COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_RECONCILOR_H_ |
| +#define COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_RECONCILOR_H_ |
| #include <deque> |
| #include <functional> |
| @@ -24,7 +24,6 @@ |
| #include "google_apis/gaia/oauth2_token_service.h" |
| class GaiaAuthFetcher; |
| -class Profile; |
| class SigninClient; |
| class SigninOAuthHelper; |
| @@ -39,7 +38,9 @@ class AccountReconcilor : public KeyedService, |
| public OAuth2TokenService::Observer, |
| public SigninManagerBase::Observer { |
| public: |
| - explicit AccountReconcilor(Profile* profile, SigninClient* client); |
| + AccountReconcilor(ProfileOAuth2TokenService* token_service, |
| + SigninManager* signin_manager, |
| + SigninClient* client); |
| virtual ~AccountReconcilor(); |
| void Initialize(bool start_reconcile_if_tokens_available); |
| @@ -51,7 +52,8 @@ class AccountReconcilor : public KeyedService, |
| void AddMergeSessionObserver(MergeSessionHelper::Observer* observer); |
| void RemoveMergeSessionObserver(MergeSessionHelper::Observer* observer); |
| - Profile* profile() { return profile_; } |
| + ProfileOAuth2TokenService* token_service() { return token_service_; } |
| + SigninClient* client() { return client_; } |
| private: |
| // An std::set<> for use with email addresses that uses |
| @@ -82,8 +84,8 @@ class AccountReconcilor : public KeyedService, |
| bool AreAllRefreshTokensChecked() const; |
| - const std::vector<std::pair<std::string, bool> >& |
| - GetGaiaAccountsForTesting() const { |
| + const std::vector<std::pair<std::string, bool> >& GetGaiaAccountsForTesting() |
| + const { |
| return gaia_accounts_; |
| } |
| @@ -97,10 +99,10 @@ class AccountReconcilor : public KeyedService, |
| // Used during GetAccountsFromCookie. |
| // Stores a callback for the next action to perform. |
| - typedef base::Callback<void( |
| - const GoogleServiceAuthError& error, |
| - const std::vector<std::pair<std::string, bool> >&)> |
| - GetAccountsFromCookieCallback; |
| + typedef base::Callback< |
| + void(const GoogleServiceAuthError& error, |
| + const std::vector<std::pair<std::string, bool> >&)> |
| + GetAccountsFromCookieCallback; |
| friend class AccountReconcilorTest; |
| FRIEND_TEST_ALL_PREFIXES(AccountReconcilorTest, SigninManagerRegistration); |
| @@ -131,7 +133,7 @@ class AccountReconcilor : public KeyedService, |
| void RegisterWithTokenService(); |
| void UnregisterWithTokenService(); |
| - bool IsProfileConnected(); |
| + bool IsUserSignedIn(); |
|
Roger Tawa OOO till Jul 10th
2014/04/01 02:26:26
I actually prefer the term "IsProfileConnected".
blundell
2014/04/01 20:40:00
Done.
|
| void DeleteFetchers(); |
| @@ -175,13 +177,13 @@ class AccountReconcilor : public KeyedService, |
| // Overriden from GaiaAuthConsumer. |
| virtual void OnListAccountsSuccess(const std::string& data) OVERRIDE; |
| - virtual void OnListAccountsFailure( |
| - const GoogleServiceAuthError& error) OVERRIDE; |
| + virtual void OnListAccountsFailure(const GoogleServiceAuthError& error) |
| + OVERRIDE; |
| // Overriden from MergeSessionHelper::Observer. |
| - virtual void MergeSessionCompleted( |
| - const std::string& account_id, |
| - const GoogleServiceAuthError& error) OVERRIDE; |
| + virtual void MergeSessionCompleted(const std::string& account_id, |
| + const GoogleServiceAuthError& error) |
| + OVERRIDE; |
| // Overriden from OAuth2TokenService::Consumer. |
| virtual void OnGetTokenSuccess(const OAuth2TokenService::Request* request, |
| @@ -202,8 +204,11 @@ class AccountReconcilor : public KeyedService, |
| void MayBeDoNextListAccounts(); |
| - // The profile that this reconcilor belongs to. |
| - Profile* profile_; |
| + // The ProfileOAuth2TokenService associated with this reconcilor. |
| + ProfileOAuth2TokenService* token_service_; |
| + |
| + // The SigninManager associated with this reconcilor. |
| + SigninManager* signin_manager_; |
| // The SigninClient associated with this reconcilor. |
| SigninClient* client_; |
| @@ -243,4 +248,4 @@ class AccountReconcilor : public KeyedService, |
| DISALLOW_COPY_AND_ASSIGN(AccountReconcilor); |
| }; |
| -#endif // CHROME_BROWSER_SIGNIN_ACCOUNT_RECONCILOR_H_ |
| +#endif // COMPONENTS_SIGNIN_CORE_BROWSER_ACCOUNT_RECONCILOR_H_ |