| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef SYNC_TEST_FAKE_SERVER_PERMANENT_ENTITY_H_ | 5 #ifndef SYNC_TEST_FAKE_SERVER_PERMANENT_ENTITY_H_ |
| 6 #define SYNC_TEST_FAKE_SERVER_PERMANENT_ENTITY_H_ | 6 #define SYNC_TEST_FAKE_SERVER_PERMANENT_ENTITY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 static FakeServerEntity* Create(const syncer::ModelType& model_type, | 24 static FakeServerEntity* Create(const syncer::ModelType& model_type, |
| 25 const std::string& server_tag, | 25 const std::string& server_tag, |
| 26 const std::string& name, | 26 const std::string& name, |
| 27 const std::string& parent_server_tag); | 27 const std::string& parent_server_tag); |
| 28 | 28 |
| 29 // Factory function for a top level PermanentEntity. Top level means that the | 29 // Factory function for a top level PermanentEntity. Top level means that the |
| 30 // entity's parent is the root entity (no PermanentEntity exists for root). | 30 // entity's parent is the root entity (no PermanentEntity exists for root). |
| 31 static FakeServerEntity* CreateTopLevel(const syncer::ModelType& model_type); | 31 static FakeServerEntity* CreateTopLevel(const syncer::ModelType& model_type); |
| 32 | 32 |
| 33 // Factory function for creating an updated version of a PermanentEntity. | 33 // Factory function for creating an updated version of a PermanentEntity. |
| 34 // This function should only be called for the Nigori entity and will return | 34 // This function should only be called for the Nigori entity. |
| 35 // NULL if any other type is specified. | |
| 36 static FakeServerEntity* CreateUpdatedNigoriEntity( | 35 static FakeServerEntity* CreateUpdatedNigoriEntity( |
| 37 const sync_pb::SyncEntity& client_entity, | 36 const sync_pb::SyncEntity& client_entity, |
| 38 FakeServerEntity* current_server_entity); | 37 FakeServerEntity* current_server_entity); |
| 39 | 38 |
| 40 // FakeServerEntity implementation. | 39 // FakeServerEntity implementation. |
| 41 virtual std::string GetParentId() const OVERRIDE; | 40 virtual std::string GetParentId() const OVERRIDE; |
| 42 virtual sync_pb::SyncEntity* SerializeAsProto() OVERRIDE; | 41 virtual sync_pb::SyncEntity* SerializeAsProto() OVERRIDE; |
| 43 virtual bool IsDeleted() const OVERRIDE; | 42 virtual bool IsDeleted() const OVERRIDE; |
| 44 virtual bool IsFolder() const OVERRIDE; | 43 virtual bool IsFolder() const OVERRIDE; |
| 45 | 44 |
| 46 private: | 45 private: |
| 47 PermanentEntity(const std::string& id, | 46 PermanentEntity(const std::string& id, |
| 48 const syncer::ModelType& model_type, | 47 const syncer::ModelType& model_type, |
| 49 const std::string& name, | 48 const std::string& name, |
| 50 const std::string& parent_id, | 49 const std::string& parent_id, |
| 51 const std::string& server_defined_unique_tag, | 50 const std::string& server_defined_unique_tag, |
| 52 const sync_pb::EntitySpecifics& entity_specifics); | 51 const sync_pb::EntitySpecifics& entity_specifics); |
| 53 | 52 |
| 54 // All member values have equivalent fields in SyncEntity. | 53 // All member values have equivalent fields in SyncEntity. |
| 55 std::string server_defined_unique_tag_; | 54 std::string server_defined_unique_tag_; |
| 56 std::string parent_id_; | 55 std::string parent_id_; |
| 57 sync_pb::EntitySpecifics specifics_; | 56 sync_pb::EntitySpecifics specifics_; |
| 58 }; | 57 }; |
| 59 | 58 |
| 60 } // namespace fake_server | 59 } // namespace fake_server |
| 61 | 60 |
| 62 #endif // SYNC_TEST_FAKE_SERVER_PERMANENT_ENTITY_H_ | 61 #endif // SYNC_TEST_FAKE_SERVER_PERMANENT_ENTITY_H_ |
| OLD | NEW |