1 // Copyright 2014 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.
5 #ifndef SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_
6 #define SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_
10 #include "base/basictypes.h"
11 #include "sync/internal_api/public/base/model_type.h"
12 #include "sync/protocol/sync.pb.h"
13 #include "sync/test/fake_server/fake_server_entity.h"
15 namespace fake_server
{
17 // An entity that is unique per client account.
18 class UniqueClientEntity
: public FakeServerEntity
{
20 virtual ~UniqueClientEntity();
22 // Factory function for UniqueClientEntity.
23 static FakeServerEntity
* CreateNew(const sync_pb::SyncEntity
& client_entity
);
25 // Factory function for creating a new version of an existing
26 // UniqueClientEntity.
27 static FakeServerEntity
* CreateUpdatedVersion(
28 const sync_pb::SyncEntity
& client_entity
,
29 FakeServerEntity
* current_server_entity
);
31 // FakeServerEntity implementation.
32 virtual std::string
GetParentId() const OVERRIDE
;
33 virtual sync_pb::SyncEntity
* SerializeAsProto() OVERRIDE
;
34 virtual bool IsDeleted() const OVERRIDE
;
35 virtual bool IsFolder() const OVERRIDE
;
38 UniqueClientEntity(const std::string
& id
,
39 const syncer::ModelType
& model_type
,
41 const std::string
& name
,
42 const std::string
& client_defined_unique_tag
,
43 const sync_pb::EntitySpecifics
& specifics
,
45 int64 last_modified_time
);
47 // These member values have equivalent fields in SyncEntity.
48 std::string client_defined_unique_tag_
;
49 sync_pb::EntitySpecifics specifics_
;
51 int64 last_modified_time_
;
54 } // namespace fake_server
56 #endif // SYNC_TEST_FAKE_SERVER_UNIQUE_CLIENT_ENTITY_H_