OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ |
6 #define CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ | 6 #define CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 protected: | 80 protected: |
81 virtual void InitCore(scoped_ptr<DoInitializeOptions> options) OVERRIDE; | 81 virtual void InitCore(scoped_ptr<DoInitializeOptions> options) OVERRIDE; |
82 | 82 |
83 private: | 83 private: |
84 void ContinueInitialization( | 84 void ContinueInitialization( |
85 const syncer::WeakHandle<syncer::JsBackend>& js_backend, | 85 const syncer::WeakHandle<syncer::JsBackend>& js_backend, |
86 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& | 86 const syncer::WeakHandle<syncer::DataTypeDebugInfoListener>& |
87 debug_info_listener, | 87 debug_info_listener, |
88 syncer::ModelTypeSet restored_types); | 88 syncer::ModelTypeSet restored_types); |
89 | 89 |
90 base::WeakPtrFactory<SyncBackendHostForProfileSyncTest> weak_ptr_factory_; | |
91 | |
92 syncer::TestIdFactory& id_factory_; | 90 syncer::TestIdFactory& id_factory_; |
93 | 91 |
94 // Invoked at the start of HandleSyncManagerInitializationOnFrontendLoop. | 92 // Invoked at the start of HandleSyncManagerInitializationOnFrontendLoop. |
95 // Allows extra initialization work to be performed before the backend comes | 93 // Allows extra initialization work to be performed before the backend comes |
96 // up. | 94 // up. |
97 base::Closure& callback_; | 95 base::Closure& callback_; |
98 | 96 |
99 // Saved closure in case we failed the initial download but then received | 97 // Saved closure in case we failed the initial download but then received |
100 // new credentials. Holds the results of | 98 // new credentials. Holds the results of |
101 // HandleSyncManagerInitializationOnFrontendLoop, and if | 99 // HandleSyncManagerInitializationOnFrontendLoop, and if |
102 // |fail_initial_download_| was true, finishes the initialization process | 100 // |fail_initial_download_| was true, finishes the initialization process |
103 // once we receive new credentials. | 101 // once we receive new credentials. |
104 base::Closure initial_download_closure_; | 102 base::Closure initial_download_closure_; |
105 bool fail_initial_download_; | 103 bool fail_initial_download_; |
106 | 104 |
107 bool set_initial_sync_ended_on_init_; | 105 bool set_initial_sync_ended_on_init_; |
108 bool synchronous_init_; | 106 bool synchronous_init_; |
109 syncer::StorageOption storage_option_; | 107 syncer::StorageOption storage_option_; |
| 108 |
| 109 base::WeakPtrFactory<SyncBackendHostForProfileSyncTest> weak_ptr_factory_; |
110 }; | 110 }; |
111 | 111 |
112 } // namespace browser_sync | 112 } // namespace browser_sync |
113 | 113 |
114 class TestProfileSyncService : public ProfileSyncService { | 114 class TestProfileSyncService : public ProfileSyncService { |
115 public: | 115 public: |
116 // TODO(tim): Remove |synchronous_backend_initialization|, and add ability to | 116 // TODO(tim): Remove |synchronous_backend_initialization|, and add ability to |
117 // inject TokenService alongside SigninManager. | 117 // inject TokenService alongside SigninManager. |
118 TestProfileSyncService( | 118 TestProfileSyncService( |
119 ProfileSyncComponentsFactory* factory, | 119 ProfileSyncComponentsFactory* factory, |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 const OAuth2TokenService::ScopeSet& scopes) OVERRIDE; | 211 const OAuth2TokenService::ScopeSet& scopes) OVERRIDE; |
212 | 212 |
213 virtual void PersistCredentials(const std::string& account_id, | 213 virtual void PersistCredentials(const std::string& account_id, |
214 const std::string& refresh_token) OVERRIDE; | 214 const std::string& refresh_token) OVERRIDE; |
215 | 215 |
216 virtual void ClearPersistedCredentials( | 216 virtual void ClearPersistedCredentials( |
217 const std::string& account_id) OVERRIDE; | 217 const std::string& account_id) OVERRIDE; |
218 }; | 218 }; |
219 | 219 |
220 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ | 220 #endif // CHROME_BROWSER_SYNC_TEST_PROFILE_SYNC_SERVICE_H_ |
OLD | NEW |