| Index: sync/api/sync_data.cc
|
| diff --git a/sync/api/sync_data.cc b/sync/api/sync_data.cc
|
| index b9e2ca999f57390a337614161fda82a51e9524f9..0cacfcf76bb71d92670ff55d72471232eb23b8ef 100644
|
| --- a/sync/api/sync_data.cc
|
| +++ b/sync/api/sync_data.cc
|
| @@ -56,30 +56,34 @@ SyncData::~SyncData() {}
|
| // Static.
|
| SyncData SyncData::CreateLocalDelete(
|
| const std::string& sync_tag,
|
| - ModelType datatype) {
|
| + ModelType datatype,
|
| + bool is_folder) {
|
| sync_pb::EntitySpecifics specifics;
|
| AddDefaultFieldValue(datatype, &specifics);
|
| - return CreateLocalData(sync_tag, "", specifics);
|
| + return CreateLocalData(sync_tag, "", specifics, is_folder);
|
| }
|
|
|
| // Static.
|
| SyncData SyncData::CreateLocalData(
|
| const std::string& sync_tag,
|
| const std::string& non_unique_title,
|
| - const sync_pb::EntitySpecifics& specifics) {
|
| + const sync_pb::EntitySpecifics& specifics,
|
| + bool is_folder) {
|
| sync_pb::SyncEntity entity;
|
| entity.set_client_defined_unique_tag(sync_tag);
|
| entity.set_non_unique_name(non_unique_title);
|
| entity.mutable_specifics()->CopyFrom(specifics);
|
| + entity.set_folder(is_folder);
|
| return SyncData(kInvalidId, &entity);
|
| }
|
|
|
| // Static.
|
| SyncData SyncData::CreateRemoteData(
|
| - int64 id, const sync_pb::EntitySpecifics& specifics) {
|
| + int64 id, const sync_pb::EntitySpecifics& specifics, bool is_folder) {
|
| DCHECK_NE(id, kInvalidId);
|
| sync_pb::SyncEntity entity;
|
| entity.mutable_specifics()->CopyFrom(specifics);
|
| + entity.set_folder(is_folder);
|
| return SyncData(id, &entity);
|
| }
|
|
|
| @@ -115,6 +119,10 @@ bool SyncData::IsLocal() const {
|
| return id_ == kInvalidId;
|
| }
|
|
|
| +bool SyncData::IsFolder() const {
|
| + return immutable_entity_.Get().folder();
|
| +}
|
| +
|
| std::string SyncData::ToString() const {
|
| if (!IsValid())
|
| return "<Invalid SyncData>";
|
|
|