| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 | 4 |
| 5 #ifndef GOOGLE_APIS_GAIA_MERGE_SESSION_HELPER_H_ | 5 #ifndef GOOGLE_APIS_GAIA_MERGE_SESSION_HELPER_H_ |
| 6 #define GOOGLE_APIS_GAIA_MERGE_SESSION_HELPER_H_ | 6 #define GOOGLE_APIS_GAIA_MERGE_SESSION_HELPER_H_ |
| 7 | 7 |
| 8 #include <deque> | 8 #include <deque> |
| 9 | 9 |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 MergeSessionHelper* helper_; | 96 MergeSessionHelper* helper_; |
| 97 base::OneShotTimer<ExternalCcResultFetcher> timer_; | 97 base::OneShotTimer<ExternalCcResultFetcher> timer_; |
| 98 scoped_ptr<GaiaAuthFetcher> gaia_auth_fetcher_; | 98 scoped_ptr<GaiaAuthFetcher> gaia_auth_fetcher_; |
| 99 URLToTokenAndFetcher fetchers_; | 99 URLToTokenAndFetcher fetchers_; |
| 100 ResultMap results_; | 100 ResultMap results_; |
| 101 | 101 |
| 102 DISALLOW_COPY_AND_ASSIGN(ExternalCcResultFetcher); | 102 DISALLOW_COPY_AND_ASSIGN(ExternalCcResultFetcher); |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 MergeSessionHelper(OAuth2TokenService* token_service, | 105 MergeSessionHelper(OAuth2TokenService* token_service, |
| 106 const std::string& source, |
| 106 net::URLRequestContextGetter* request_context, | 107 net::URLRequestContextGetter* request_context, |
| 107 Observer* observer); | 108 Observer* observer); |
| 108 virtual ~MergeSessionHelper(); | 109 virtual ~MergeSessionHelper(); |
| 109 | 110 |
| 110 void LogIn(const std::string& account_id); | 111 void LogIn(const std::string& account_id); |
| 111 | 112 |
| 112 // Add or remove observers of this helper. | 113 // Add or remove observers of this helper. |
| 113 void AddObserver(Observer* observer); | 114 void AddObserver(Observer* observer); |
| 114 void RemoveObserver(Observer* observer); | 115 void RemoveObserver(Observer* observer); |
| 115 | 116 |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 180 |
| 180 // A worklist for this class. Accounts names are stored here if | 181 // A worklist for this class. Accounts names are stored here if |
| 181 // we are pending a signin action for that account. Empty strings | 182 // we are pending a signin action for that account. Empty strings |
| 182 // represent a signout request. | 183 // represent a signout request. |
| 183 std::deque<std::string> accounts_; | 184 std::deque<std::string> accounts_; |
| 184 | 185 |
| 185 // List of observers to notify when merge session completes. | 186 // List of observers to notify when merge session completes. |
| 186 // Makes sure list is empty on destruction. | 187 // Makes sure list is empty on destruction. |
| 187 ObserverList<Observer, true> observer_list_; | 188 ObserverList<Observer, true> observer_list_; |
| 188 | 189 |
| 190 // Source to use with GAIA endpoints for accounting. |
| 191 std::string source_; |
| 192 |
| 189 DISALLOW_COPY_AND_ASSIGN(MergeSessionHelper); | 193 DISALLOW_COPY_AND_ASSIGN(MergeSessionHelper); |
| 190 }; | 194 }; |
| 191 | 195 |
| 192 #endif // GOOGLE_APIS_GAIA_MERGE_SESSION_HELPER_H_ | 196 #endif // GOOGLE_APIS_GAIA_MERGE_SESSION_HELPER_H_ |
| OLD | NEW |