| 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 #include "sync/api/fake_syncable_service.h" | 5 #include "sync/api/fake_syncable_service.h" |
| 6 | 6 |
| 7 #include "base/location.h" | 7 #include "base/location.h" |
| 8 #include "sync/api/sync_error_factory.h" | 8 #include "sync/api/sync_error_factory.h" |
| 9 | 9 |
| 10 namespace syncer { | 10 namespace syncer { |
| 11 | 11 |
| 12 FakeSyncableService::FakeSyncableService() | 12 FakeSyncableService::FakeSyncableService() |
| 13 : syncing_(false), | 13 : syncing_(false), |
| 14 type_(UNSPECIFIED) {} | 14 type_(UNSPECIFIED) {} |
| 15 | 15 |
| 16 FakeSyncableService::~FakeSyncableService() {} | 16 FakeSyncableService::~FakeSyncableService() {} |
| 17 | 17 |
| 18 void FakeSyncableService::set_merge_data_and_start_syncing_error( | 18 void FakeSyncableService::set_merge_data_and_start_syncing_error( |
| 19 const SyncError& error) { | 19 const SyncError& error) { |
| 20 merge_data_and_start_syncing_error_ = error; | 20 merge_data_and_start_syncing_error_ = error; |
| 21 } | 21 } |
| 22 | 22 |
| 23 void FakeSyncableService::set_process_sync_changes_error( | 23 void FakeSyncableService::set_process_sync_changes_error( |
| 24 const SyncError& error) { | 24 const SyncError& error) { |
| 25 process_sync_changes_error_ = error; | 25 process_sync_changes_error_ = error; |
| 26 } | 26 } |
| 27 | 27 |
| 28 void FakeSyncableService::set_attachment_store( | 28 void FakeSyncableService::set_attachment_store( |
| 29 scoped_ptr<AttachmentStore> attachment_store) { | 29 const scoped_refptr<AttachmentStore>& attachment_store) { |
| 30 attachment_store_ = attachment_store.Pass(); | 30 attachment_store_ = attachment_store; |
| 31 } | 31 } |
| 32 | 32 |
| 33 const AttachmentService* FakeSyncableService::attachment_service() const { | 33 const AttachmentService* FakeSyncableService::attachment_service() const { |
| 34 return attachment_service_.get(); | 34 return attachment_service_.get(); |
| 35 } | 35 } |
| 36 | 36 |
| 37 bool FakeSyncableService::syncing() const { | 37 bool FakeSyncableService::syncing() const { |
| 38 return syncing_; | 38 return syncing_; |
| 39 } | 39 } |
| 40 | 40 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 63 SyncDataList FakeSyncableService::GetAllSyncData(ModelType type) const { | 63 SyncDataList FakeSyncableService::GetAllSyncData(ModelType type) const { |
| 64 return SyncDataList(); | 64 return SyncDataList(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 SyncError FakeSyncableService::ProcessSyncChanges( | 67 SyncError FakeSyncableService::ProcessSyncChanges( |
| 68 const tracked_objects::Location& from_here, | 68 const tracked_objects::Location& from_here, |
| 69 const SyncChangeList& change_list) { | 69 const SyncChangeList& change_list) { |
| 70 return process_sync_changes_error_; | 70 return process_sync_changes_error_; |
| 71 } | 71 } |
| 72 | 72 |
| 73 scoped_ptr<AttachmentStore> FakeSyncableService::GetAttachmentStoreForSync() { | 73 scoped_refptr<AttachmentStore> FakeSyncableService::GetAttachmentStore() { |
| 74 return attachment_store_ ? attachment_store_->CreateAttachmentStoreForSync() | 74 return attachment_store_; |
| 75 : scoped_ptr<AttachmentStore>(); | |
| 76 } | 75 } |
| 77 | 76 |
| 78 void FakeSyncableService::SetAttachmentService( | 77 void FakeSyncableService::SetAttachmentService( |
| 79 scoped_ptr<AttachmentService> attachment_service) { | 78 scoped_ptr<AttachmentService> attachment_service) { |
| 80 attachment_service_ = attachment_service.Pass(); | 79 attachment_service_ = attachment_service.Pass(); |
| 81 } | 80 } |
| 82 | 81 |
| 83 } // namespace syncer | 82 } // namespace syncer |
| OLD | NEW |