OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "components/sync_driver/fake_sync_service.h" | |
6 | |
7 #include "base/memory/ptr_util.h" | |
8 #include "base/values.h" | |
9 #include "components/sync/core/base_transaction.h" | |
10 #include "components/sync/core/user_share.h" | |
11 #include "components/sync/sessions/sync_session_snapshot.h" | |
12 | |
13 namespace sync_driver { | |
14 | |
15 FakeSyncService::FakeSyncService() | |
16 : error_(GoogleServiceAuthError::NONE), | |
17 user_share_(base::WrapUnique(new syncer::UserShare())) {} | |
18 | |
19 FakeSyncService::~FakeSyncService() { | |
20 } | |
21 | |
22 bool FakeSyncService::IsFirstSetupComplete() const { | |
23 return false; | |
24 } | |
25 | |
26 bool FakeSyncService::IsSyncAllowed() const { | |
27 return false; | |
28 } | |
29 | |
30 bool FakeSyncService::IsSyncActive() const { | |
31 return false; | |
32 } | |
33 | |
34 void FakeSyncService::TriggerRefresh(const syncer::ModelTypeSet& types) {} | |
35 | |
36 syncer::ModelTypeSet FakeSyncService::GetActiveDataTypes() const { | |
37 return syncer::ModelTypeSet(); | |
38 } | |
39 | |
40 SyncClient* FakeSyncService::GetSyncClient() const { | |
41 return nullptr; | |
42 } | |
43 | |
44 void FakeSyncService::AddObserver(SyncServiceObserver* observer) { | |
45 } | |
46 | |
47 void FakeSyncService::RemoveObserver(SyncServiceObserver* observer) { | |
48 } | |
49 | |
50 bool FakeSyncService::HasObserver(const SyncServiceObserver* observer) const { | |
51 return false; | |
52 } | |
53 | |
54 bool FakeSyncService::CanSyncStart() const { | |
55 return false; | |
56 } | |
57 | |
58 void FakeSyncService::OnDataTypeRequestsSyncStartup(syncer::ModelType type) { | |
59 } | |
60 | |
61 void FakeSyncService::RequestStop( | |
62 sync_driver::SyncService::SyncStopDataFate data_fate) { | |
63 } | |
64 | |
65 void FakeSyncService::RequestStart() { | |
66 } | |
67 | |
68 syncer::ModelTypeSet FakeSyncService::GetPreferredDataTypes() const { | |
69 return syncer::ModelTypeSet(); | |
70 } | |
71 | |
72 void FakeSyncService::OnUserChoseDatatypes(bool sync_everything, | |
73 syncer::ModelTypeSet chosen_types) { | |
74 } | |
75 | |
76 void FakeSyncService::SetFirstSetupComplete() {} | |
77 | |
78 bool FakeSyncService::IsFirstSetupInProgress() const { | |
79 return false; | |
80 } | |
81 | |
82 std::unique_ptr<SyncSetupInProgressHandle> | |
83 FakeSyncService::GetSetupInProgressHandle() { | |
84 return nullptr; | |
85 } | |
86 | |
87 bool FakeSyncService::IsSetupInProgress() const { | |
88 return false; | |
89 } | |
90 | |
91 bool FakeSyncService::ConfigurationDone() const { | |
92 return false; | |
93 } | |
94 | |
95 const GoogleServiceAuthError& FakeSyncService::GetAuthError() const { | |
96 return error_; | |
97 } | |
98 | |
99 bool FakeSyncService::HasUnrecoverableError() const { | |
100 return false; | |
101 } | |
102 | |
103 bool FakeSyncService::IsBackendInitialized() const { | |
104 return false; | |
105 } | |
106 | |
107 OpenTabsUIDelegate* FakeSyncService::GetOpenTabsUIDelegate() { | |
108 return nullptr; | |
109 } | |
110 | |
111 bool FakeSyncService::IsPassphraseRequiredForDecryption() const { | |
112 return false; | |
113 } | |
114 | |
115 base::Time FakeSyncService::GetExplicitPassphraseTime() const { | |
116 return base::Time(); | |
117 } | |
118 | |
119 bool FakeSyncService::IsUsingSecondaryPassphrase() const { | |
120 return false; | |
121 } | |
122 | |
123 void FakeSyncService::EnableEncryptEverything() { | |
124 } | |
125 | |
126 bool FakeSyncService::IsEncryptEverythingEnabled() const { | |
127 return false; | |
128 } | |
129 | |
130 void FakeSyncService::SetEncryptionPassphrase(const std::string& passphrase, | |
131 PassphraseType type) { | |
132 } | |
133 | |
134 bool FakeSyncService::SetDecryptionPassphrase(const std::string& passphrase) { | |
135 return false; | |
136 } | |
137 | |
138 bool FakeSyncService::IsCryptographerReady( | |
139 const syncer::BaseTransaction* trans) const { | |
140 return false; | |
141 } | |
142 | |
143 syncer::UserShare* FakeSyncService::GetUserShare() const { | |
144 return user_share_.get(); | |
145 } | |
146 | |
147 LocalDeviceInfoProvider* FakeSyncService::GetLocalDeviceInfoProvider() const { | |
148 return nullptr; | |
149 } | |
150 | |
151 void FakeSyncService::RegisterDataTypeController( | |
152 sync_driver::DataTypeController* data_type_controller) { | |
153 } | |
154 | |
155 void FakeSyncService::ReenableDatatype(syncer::ModelType type) {} | |
156 | |
157 bool FakeSyncService::IsPassphraseRequired() const { | |
158 return false; | |
159 } | |
160 | |
161 syncer::ModelTypeSet FakeSyncService::GetEncryptedDataTypes() const { | |
162 return syncer::ModelTypeSet(); | |
163 } | |
164 | |
165 FakeSyncService::SyncTokenStatus FakeSyncService::GetSyncTokenStatus() const { | |
166 return FakeSyncService::SyncTokenStatus(); | |
167 } | |
168 | |
169 std::string FakeSyncService::QuerySyncStatusSummaryString() { | |
170 return ""; | |
171 } | |
172 | |
173 bool FakeSyncService::QueryDetailedSyncStatus(syncer::SyncStatus* result) { | |
174 return false; | |
175 } | |
176 | |
177 base::string16 FakeSyncService::GetLastSyncedTimeString() const { | |
178 return base::string16(); | |
179 } | |
180 | |
181 std::string FakeSyncService::GetBackendInitializationStateString() const { | |
182 return std::string(); | |
183 } | |
184 | |
185 syncer::sessions::SyncSessionSnapshot FakeSyncService::GetLastSessionSnapshot() | |
186 const { | |
187 return syncer::sessions::SyncSessionSnapshot(); | |
188 } | |
189 | |
190 base::Value* FakeSyncService::GetTypeStatusMap() const { | |
191 return new base::ListValue(); | |
192 } | |
193 | |
194 const GURL& FakeSyncService::sync_service_url() const { | |
195 return sync_service_url_; | |
196 } | |
197 | |
198 std::string FakeSyncService::unrecoverable_error_message() const { | |
199 return unrecoverable_error_message_; | |
200 } | |
201 | |
202 tracked_objects::Location FakeSyncService::unrecoverable_error_location() | |
203 const { | |
204 return tracked_objects::Location(); | |
205 } | |
206 | |
207 void FakeSyncService::AddProtocolEventObserver( | |
208 browser_sync::ProtocolEventObserver* observer) {} | |
209 | |
210 void FakeSyncService::RemoveProtocolEventObserver( | |
211 browser_sync::ProtocolEventObserver* observer) {} | |
212 | |
213 void FakeSyncService::AddTypeDebugInfoObserver( | |
214 syncer::TypeDebugInfoObserver* observer) {} | |
215 | |
216 void FakeSyncService::RemoveTypeDebugInfoObserver( | |
217 syncer::TypeDebugInfoObserver* observer) {} | |
218 | |
219 base::WeakPtr<syncer::JsController> FakeSyncService::GetJsController() { | |
220 return base::WeakPtr<syncer::JsController>(); | |
221 } | |
222 | |
223 void FakeSyncService::GetAllNodes( | |
224 const base::Callback<void(std::unique_ptr<base::ListValue>)>& callback) {} | |
225 | |
226 } // namespace sync_driver | |
OLD | NEW |