OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_TEST_UTIL_H_ | 5 #ifndef COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_TEST_UTIL_H_ |
6 #define COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_TEST_UTIL_H_ | 6 #define COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_TEST_UTIL_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 const base::Callback<base::WeakPtr<syncer::SyncableService>( | 92 const base::Callback<base::WeakPtr<syncer::SyncableService>( |
93 syncer::ModelType type)>& get_syncable_service_callback); | 93 syncer::ModelType type)>& get_syncable_service_callback); |
94 | 94 |
95 // The client will call this callback to produce the SyncService for the | 95 // The client will call this callback to produce the SyncService for the |
96 // current Profile. | 96 // current Profile. |
97 void SetSyncServiceCallback(const base::Callback<sync_driver::SyncService*( | 97 void SetSyncServiceCallback(const base::Callback<sync_driver::SyncService*( |
98 void)>& get_sync_service_callback); | 98 void)>& get_sync_service_callback); |
99 | 99 |
100 void SetHistoryService(history::HistoryService* history_service); | 100 void SetHistoryService(history::HistoryService* history_service); |
101 | 101 |
| 102 void SetBookmarkModelCallback( |
| 103 const base::Callback<bookmarks::BookmarkModel*(void)>& |
| 104 get_bookmark_model_callback); |
| 105 |
102 void set_activate_model_creation() { activate_model_creation_ = true; } | 106 void set_activate_model_creation() { activate_model_creation_ = true; } |
103 | 107 |
104 scoped_ptr<sync_driver::FakeSyncClient> Build(); | 108 scoped_ptr<sync_driver::FakeSyncClient> Build(); |
105 | 109 |
106 private: | 110 private: |
107 // Associated bundle to source objects from. | 111 // Associated bundle to source objects from. |
108 ProfileSyncServiceBundle* const bundle_; | 112 ProfileSyncServiceBundle* const bundle_; |
109 | 113 |
110 sync_driver::ClearBrowsingDataCallback clear_browsing_data_callback_; | 114 sync_driver::ClearBrowsingDataCallback clear_browsing_data_callback_; |
111 autofill::PersonalDataManager* personal_data_manager_; | 115 autofill::PersonalDataManager* personal_data_manager_; |
112 base::Callback<base::WeakPtr<syncer::SyncableService>( | 116 base::Callback<base::WeakPtr<syncer::SyncableService>( |
113 syncer::ModelType type)> | 117 syncer::ModelType type)> |
114 get_syncable_service_callback_; | 118 get_syncable_service_callback_; |
115 base::Callback<sync_driver::SyncService*(void)> get_sync_service_callback_; | 119 base::Callback<sync_driver::SyncService*(void)> get_sync_service_callback_; |
116 history::HistoryService* history_service_ = nullptr; | 120 history::HistoryService* history_service_ = nullptr; |
| 121 base::Callback<bookmarks::BookmarkModel*(void)> |
| 122 get_bookmark_model_callback_; |
117 // If set, the built client will be able to build some ModelSafeWorker | 123 // If set, the built client will be able to build some ModelSafeWorker |
118 // instances. | 124 // instances. |
119 bool activate_model_creation_ = false; | 125 bool activate_model_creation_ = false; |
120 | 126 |
121 DISALLOW_COPY_AND_ASSIGN(SyncClientBuilder); | 127 DISALLOW_COPY_AND_ASSIGN(SyncClientBuilder); |
122 }; | 128 }; |
123 | 129 |
124 // Creates an InitParams instance with the specified |start_behavior| and | 130 // Creates an InitParams instance with the specified |start_behavior| and |
125 // |sync_client|, and fills the rest with dummy values and objects owned by | 131 // |sync_client|, and fills the rest with dummy values and objects owned by |
126 // the bundle. | 132 // the bundle. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 sync_sessions::FakeSyncSessionsClient sync_sessions_client_; | 181 sync_sessions::FakeSyncSessionsClient sync_sessions_client_; |
176 invalidation::FakeInvalidationService fake_invalidation_service_; | 182 invalidation::FakeInvalidationService fake_invalidation_service_; |
177 scoped_refptr<net::URLRequestContextGetter> url_request_context_; | 183 scoped_refptr<net::URLRequestContextGetter> url_request_context_; |
178 | 184 |
179 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceBundle); | 185 DISALLOW_COPY_AND_ASSIGN(ProfileSyncServiceBundle); |
180 }; | 186 }; |
181 | 187 |
182 } // namespace browser_sync | 188 } // namespace browser_sync |
183 | 189 |
184 #endif // COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_TEST_UTIL_H_ | 190 #endif // COMPONENTS_BROWSER_SYNC_BROWSER_PROFILE_SYNC_TEST_UTIL_H_ |
OLD | NEW |