OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "components/sync/driver/fake_sync_service.h" | 5 #include "components/sync/driver/fake_sync_service.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "components/sync/core/base_transaction.h" | 9 #include "components/sync/core/base_transaction.h" |
10 #include "components/sync/core/user_share.h" | 10 #include "components/sync/core/user_share.h" |
11 #include "components/sync/driver/data_type_controller.h" | 11 #include "components/sync/driver/data_type_controller.h" |
12 #include "components/sync/engine/cycle/sync_cycle_snapshot.h" | 12 #include "components/sync/engine/cycle/sync_cycle_snapshot.h" |
13 | 13 |
14 namespace sync_driver { | 14 namespace syncer { |
15 | 15 |
16 FakeSyncService::FakeSyncService() | 16 FakeSyncService::FakeSyncService() |
17 : error_(GoogleServiceAuthError::NONE), | 17 : error_(GoogleServiceAuthError::NONE), |
18 user_share_(base::MakeUnique<syncer::UserShare>()) {} | 18 user_share_(base::MakeUnique<UserShare>()) {} |
19 | 19 |
20 FakeSyncService::~FakeSyncService() {} | 20 FakeSyncService::~FakeSyncService() {} |
21 | 21 |
22 bool FakeSyncService::IsFirstSetupComplete() const { | 22 bool FakeSyncService::IsFirstSetupComplete() const { |
23 return false; | 23 return false; |
24 } | 24 } |
25 | 25 |
26 bool FakeSyncService::IsSyncAllowed() const { | 26 bool FakeSyncService::IsSyncAllowed() const { |
27 return false; | 27 return false; |
28 } | 28 } |
29 | 29 |
30 bool FakeSyncService::IsSyncActive() const { | 30 bool FakeSyncService::IsSyncActive() const { |
31 return false; | 31 return false; |
32 } | 32 } |
33 | 33 |
34 void FakeSyncService::TriggerRefresh(const syncer::ModelTypeSet& types) {} | 34 void FakeSyncService::TriggerRefresh(const ModelTypeSet& types) {} |
35 | 35 |
36 syncer::ModelTypeSet FakeSyncService::GetActiveDataTypes() const { | 36 ModelTypeSet FakeSyncService::GetActiveDataTypes() const { |
37 return syncer::ModelTypeSet(); | 37 return ModelTypeSet(); |
38 } | 38 } |
39 | 39 |
40 SyncClient* FakeSyncService::GetSyncClient() const { | 40 SyncClient* FakeSyncService::GetSyncClient() const { |
41 return nullptr; | 41 return nullptr; |
42 } | 42 } |
43 | 43 |
44 void FakeSyncService::AddObserver(SyncServiceObserver* observer) {} | 44 void FakeSyncService::AddObserver(SyncServiceObserver* observer) {} |
45 | 45 |
46 void FakeSyncService::RemoveObserver(SyncServiceObserver* observer) {} | 46 void FakeSyncService::RemoveObserver(SyncServiceObserver* observer) {} |
47 | 47 |
48 bool FakeSyncService::HasObserver(const SyncServiceObserver* observer) const { | 48 bool FakeSyncService::HasObserver(const SyncServiceObserver* observer) const { |
49 return false; | 49 return false; |
50 } | 50 } |
51 | 51 |
52 bool FakeSyncService::CanSyncStart() const { | 52 bool FakeSyncService::CanSyncStart() const { |
53 return false; | 53 return false; |
54 } | 54 } |
55 | 55 |
56 void FakeSyncService::OnDataTypeRequestsSyncStartup(syncer::ModelType type) {} | 56 void FakeSyncService::OnDataTypeRequestsSyncStartup(ModelType type) {} |
57 | 57 |
58 void FakeSyncService::RequestStop( | 58 void FakeSyncService::RequestStop(SyncService::SyncStopDataFate data_fate) {} |
59 sync_driver::SyncService::SyncStopDataFate data_fate) {} | |
60 | 59 |
61 void FakeSyncService::RequestStart() {} | 60 void FakeSyncService::RequestStart() {} |
62 | 61 |
63 syncer::ModelTypeSet FakeSyncService::GetPreferredDataTypes() const { | 62 ModelTypeSet FakeSyncService::GetPreferredDataTypes() const { |
64 return syncer::ModelTypeSet(); | 63 return ModelTypeSet(); |
65 } | 64 } |
66 | 65 |
67 void FakeSyncService::OnUserChoseDatatypes(bool sync_everything, | 66 void FakeSyncService::OnUserChoseDatatypes(bool sync_everything, |
68 syncer::ModelTypeSet chosen_types) {} | 67 ModelTypeSet chosen_types) {} |
69 | 68 |
70 void FakeSyncService::SetFirstSetupComplete() {} | 69 void FakeSyncService::SetFirstSetupComplete() {} |
71 | 70 |
72 bool FakeSyncService::IsFirstSetupInProgress() const { | 71 bool FakeSyncService::IsFirstSetupInProgress() const { |
73 return false; | 72 return false; |
74 } | 73 } |
75 | 74 |
76 std::unique_ptr<SyncSetupInProgressHandle> | 75 std::unique_ptr<SyncSetupInProgressHandle> |
77 FakeSyncService::GetSetupInProgressHandle() { | 76 FakeSyncService::GetSetupInProgressHandle() { |
78 return nullptr; | 77 return nullptr; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 return false; | 119 return false; |
121 } | 120 } |
122 | 121 |
123 void FakeSyncService::SetEncryptionPassphrase(const std::string& passphrase, | 122 void FakeSyncService::SetEncryptionPassphrase(const std::string& passphrase, |
124 PassphraseType type) {} | 123 PassphraseType type) {} |
125 | 124 |
126 bool FakeSyncService::SetDecryptionPassphrase(const std::string& passphrase) { | 125 bool FakeSyncService::SetDecryptionPassphrase(const std::string& passphrase) { |
127 return false; | 126 return false; |
128 } | 127 } |
129 | 128 |
130 bool FakeSyncService::IsCryptographerReady( | 129 bool FakeSyncService::IsCryptographerReady(const BaseTransaction* trans) const { |
131 const syncer::BaseTransaction* trans) const { | |
132 return false; | 130 return false; |
133 } | 131 } |
134 | 132 |
135 syncer::UserShare* FakeSyncService::GetUserShare() const { | 133 UserShare* FakeSyncService::GetUserShare() const { |
136 return user_share_.get(); | 134 return user_share_.get(); |
137 } | 135 } |
138 | 136 |
139 LocalDeviceInfoProvider* FakeSyncService::GetLocalDeviceInfoProvider() const { | 137 LocalDeviceInfoProvider* FakeSyncService::GetLocalDeviceInfoProvider() const { |
140 return nullptr; | 138 return nullptr; |
141 } | 139 } |
142 | 140 |
143 void FakeSyncService::RegisterDataTypeController( | 141 void FakeSyncService::RegisterDataTypeController( |
144 std::unique_ptr<sync_driver::DataTypeController> data_type_controller) {} | 142 std::unique_ptr<DataTypeController> data_type_controller) {} |
145 | 143 |
146 void FakeSyncService::ReenableDatatype(syncer::ModelType type) {} | 144 void FakeSyncService::ReenableDatatype(ModelType type) {} |
147 | 145 |
148 bool FakeSyncService::IsPassphraseRequired() const { | 146 bool FakeSyncService::IsPassphraseRequired() const { |
149 return false; | 147 return false; |
150 } | 148 } |
151 | 149 |
152 syncer::ModelTypeSet FakeSyncService::GetEncryptedDataTypes() const { | 150 ModelTypeSet FakeSyncService::GetEncryptedDataTypes() const { |
153 return syncer::ModelTypeSet(); | 151 return ModelTypeSet(); |
154 } | 152 } |
155 | 153 |
156 FakeSyncService::SyncTokenStatus FakeSyncService::GetSyncTokenStatus() const { | 154 FakeSyncService::SyncTokenStatus FakeSyncService::GetSyncTokenStatus() const { |
157 return FakeSyncService::SyncTokenStatus(); | 155 return FakeSyncService::SyncTokenStatus(); |
158 } | 156 } |
159 | 157 |
160 std::string FakeSyncService::QuerySyncStatusSummaryString() { | 158 std::string FakeSyncService::QuerySyncStatusSummaryString() { |
161 return ""; | 159 return ""; |
162 } | 160 } |
163 | 161 |
164 bool FakeSyncService::QueryDetailedSyncStatus(syncer::SyncStatus* result) { | 162 bool FakeSyncService::QueryDetailedSyncStatus(SyncStatus* result) { |
165 return false; | 163 return false; |
166 } | 164 } |
167 | 165 |
168 base::string16 FakeSyncService::GetLastSyncedTimeString() const { | 166 base::string16 FakeSyncService::GetLastSyncedTimeString() const { |
169 return base::string16(); | 167 return base::string16(); |
170 } | 168 } |
171 | 169 |
172 std::string FakeSyncService::GetBackendInitializationStateString() const { | 170 std::string FakeSyncService::GetBackendInitializationStateString() const { |
173 return std::string(); | 171 return std::string(); |
174 } | 172 } |
175 | 173 |
176 syncer::SyncCycleSnapshot FakeSyncService::GetLastCycleSnapshot() const { | 174 SyncCycleSnapshot FakeSyncService::GetLastCycleSnapshot() const { |
177 return syncer::SyncCycleSnapshot(); | 175 return SyncCycleSnapshot(); |
178 } | 176 } |
179 | 177 |
180 base::Value* FakeSyncService::GetTypeStatusMap() const { | 178 base::Value* FakeSyncService::GetTypeStatusMap() const { |
181 return new base::ListValue(); | 179 return new base::ListValue(); |
182 } | 180 } |
183 | 181 |
184 const GURL& FakeSyncService::sync_service_url() const { | 182 const GURL& FakeSyncService::sync_service_url() const { |
185 return sync_service_url_; | 183 return sync_service_url_; |
186 } | 184 } |
187 | 185 |
188 std::string FakeSyncService::unrecoverable_error_message() const { | 186 std::string FakeSyncService::unrecoverable_error_message() const { |
189 return unrecoverable_error_message_; | 187 return unrecoverable_error_message_; |
190 } | 188 } |
191 | 189 |
192 tracked_objects::Location FakeSyncService::unrecoverable_error_location() | 190 tracked_objects::Location FakeSyncService::unrecoverable_error_location() |
193 const { | 191 const { |
194 return tracked_objects::Location(); | 192 return tracked_objects::Location(); |
195 } | 193 } |
196 | 194 |
197 void FakeSyncService::AddProtocolEventObserver( | 195 void FakeSyncService::AddProtocolEventObserver( |
198 browser_sync::ProtocolEventObserver* observer) {} | 196 ProtocolEventObserver* observer) {} |
199 | 197 |
200 void FakeSyncService::RemoveProtocolEventObserver( | 198 void FakeSyncService::RemoveProtocolEventObserver( |
201 browser_sync::ProtocolEventObserver* observer) {} | 199 ProtocolEventObserver* observer) {} |
202 | 200 |
203 void FakeSyncService::AddTypeDebugInfoObserver( | 201 void FakeSyncService::AddTypeDebugInfoObserver( |
204 syncer::TypeDebugInfoObserver* observer) {} | 202 TypeDebugInfoObserver* observer) {} |
205 | 203 |
206 void FakeSyncService::RemoveTypeDebugInfoObserver( | 204 void FakeSyncService::RemoveTypeDebugInfoObserver( |
207 syncer::TypeDebugInfoObserver* observer) {} | 205 TypeDebugInfoObserver* observer) {} |
208 | 206 |
209 base::WeakPtr<syncer::JsController> FakeSyncService::GetJsController() { | 207 base::WeakPtr<JsController> FakeSyncService::GetJsController() { |
210 return base::WeakPtr<syncer::JsController>(); | 208 return base::WeakPtr<JsController>(); |
211 } | 209 } |
212 | 210 |
213 void FakeSyncService::GetAllNodes( | 211 void FakeSyncService::GetAllNodes( |
214 const base::Callback<void(std::unique_ptr<base::ListValue>)>& callback) {} | 212 const base::Callback<void(std::unique_ptr<base::ListValue>)>& callback) {} |
215 | 213 |
216 } // namespace sync_driver | 214 } // namespace syncer |
OLD | NEW |