| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 #ifndef CHROME_BROWSER_SIGNIN_ACCOUNT_RECONCILOR_H_ | 4 #ifndef CHROME_BROWSER_SIGNIN_ACCOUNT_RECONCILOR_H_ |
| 5 #define CHROME_BROWSER_SIGNIN_ACCOUNT_RECONCILOR_H_ | 5 #define CHROME_BROWSER_SIGNIN_ACCOUNT_RECONCILOR_H_ |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/scoped_vector.h" | 10 #include "base/memory/scoped_vector.h" |
| 11 #include "chrome/browser/signin/google_auto_login_helper.h" |
| 11 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" | 12 #include "components/browser_context_keyed_service/browser_context_keyed_service
.h" |
| 12 #include "content/public/browser/notification_observer.h" | 13 #include "content/public/browser/notification_observer.h" |
| 13 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
| 14 #include "google_apis/gaia/gaia_auth_consumer.h" | 15 #include "google_apis/gaia/gaia_auth_consumer.h" |
| 15 #include "google_apis/gaia/oauth2_token_service.h" | 16 #include "google_apis/gaia/oauth2_token_service.h" |
| 16 | 17 |
| 17 class GaiaAuthFetcher; | 18 class GaiaAuthFetcher; |
| 18 class Profile; | 19 class Profile; |
| 19 struct ChromeCookieDetails; | 20 struct ChromeCookieDetails; |
| 20 | 21 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 120 |
| 120 // Overriden from GaiaAuthConsumer. | 121 // Overriden from GaiaAuthConsumer. |
| 121 virtual void OnListAccountsSuccess(const std::string& data) OVERRIDE; | 122 virtual void OnListAccountsSuccess(const std::string& data) OVERRIDE; |
| 122 virtual void OnListAccountsFailure( | 123 virtual void OnListAccountsFailure( |
| 123 const GoogleServiceAuthError& error) OVERRIDE; | 124 const GoogleServiceAuthError& error) OVERRIDE; |
| 124 | 125 |
| 125 // The profile that this reconcilor belongs to. | 126 // The profile that this reconcilor belongs to. |
| 126 Profile* profile_; | 127 Profile* profile_; |
| 127 content::NotificationRegistrar registrar_; | 128 content::NotificationRegistrar registrar_; |
| 128 base::RepeatingTimer<AccountReconcilor> reconciliation_timer_; | 129 base::RepeatingTimer<AccountReconcilor> reconciliation_timer_; |
| 130 GoogleAutoLoginHelper merge_session_helper_; |
| 129 bool registered_with_token_service_; | 131 bool registered_with_token_service_; |
| 130 | 132 |
| 131 // Used during reconcile action. | 133 // Used during reconcile action. |
| 132 // These members are used used to validate the gaia cookie. | 134 // These members are used used to validate the gaia cookie. |
| 133 scoped_ptr<GaiaAuthFetcher> gaia_fetcher_; | 135 scoped_ptr<GaiaAuthFetcher> gaia_fetcher_; |
| 134 bool are_gaia_accounts_set_; | 136 bool are_gaia_accounts_set_; |
| 135 std::vector<std::string> gaia_accounts_; | 137 std::vector<std::string> gaia_accounts_; |
| 136 | 138 |
| 137 // Used during reconcile action. | 139 // Used during reconcile action. |
| 138 // These members are used to validate the tokens in OAuth2TokenService. | 140 // These members are used to validate the tokens in OAuth2TokenService. |
| 139 std::string primary_account_; | 141 std::string primary_account_; |
| 140 std::vector<std::string> chrome_accounts_; | 142 std::vector<std::string> chrome_accounts_; |
| 141 scoped_ptr<OAuth2TokenService::Request>* requests_; | 143 scoped_ptr<OAuth2TokenService::Request>* requests_; |
| 142 ScopedVector<UserIdFetcher> user_id_fetchers_; | 144 ScopedVector<UserIdFetcher> user_id_fetchers_; |
| 143 std::set<std::string> valid_chrome_accounts_; | 145 std::set<std::string> valid_chrome_accounts_; |
| 144 std::set<std::string> invalid_chrome_accounts_; | 146 std::set<std::string> invalid_chrome_accounts_; |
| 145 | 147 |
| 146 DISALLOW_COPY_AND_ASSIGN(AccountReconcilor); | 148 DISALLOW_COPY_AND_ASSIGN(AccountReconcilor); |
| 147 }; | 149 }; |
| 148 | 150 |
| 149 #endif // CHROME_BROWSER_SIGNIN_ACCOUNT_RECONCILOR_H_ | 151 #endif // CHROME_BROWSER_SIGNIN_ACCOUNT_RECONCILOR_H_ |
| OLD | NEW |