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