15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved. 25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// found in the LICENSE file. 45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 55d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#ifndef SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_ 65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#define SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_ 75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "sync/api/sync_change_processor.h" 95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)namespace syncer { 115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class FakeSyncChangeProcessor : public SyncChangeProcessor { 135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) public: 145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) FakeSyncChangeProcessor(); 155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual ~FakeSyncChangeProcessor(); 165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 17a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // SyncChangeProcessor implementation. 18a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // 19a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // ProcessSyncChanges will accumulate changes in changes() until they are 20a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // cleared. 215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual syncer::SyncError ProcessSyncChanges( 225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) const tracked_objects::Location& from_here, 235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) const syncer::SyncChangeList& change_list) OVERRIDE; 245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 25a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // SyncChangeProcessor implementation. 26a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // 27f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) // Returns data(). 285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual syncer::SyncDataList GetAllSyncData(syncer::ModelType type) 295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) const OVERRIDE; 30a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 31f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) // SyncChangeProcessor implementation. 32f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) // 33f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) // Updates context(). 34f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) virtual syncer::SyncError UpdateDataTypeContext( 35f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) ModelType type, 36f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) ContextRefreshStatus refresh_status, 37f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) const std::string& context) OVERRIDE; 38f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) 39a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual const syncer::SyncChangeList& changes() const; 40a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) virtual syncer::SyncChangeList& changes(); 41a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 42f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) virtual const syncer::SyncDataList& data() const; 43f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) virtual syncer::SyncDataList& data(); 44f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) 45f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) virtual const std::string& context() const; 46f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) virtual std::string& context(); 47f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) 48a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) private: 49f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) syncer::SyncChangeList changes_; 50f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) syncer::SyncDataList data_; 51f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles) std::string context_; 52a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 53a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(FakeSyncChangeProcessor); 545d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}; 555d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 565d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} // namespace syncer 575d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 585d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#endif // SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_ 59