OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/sync/api/sync_data.h" | 5 #include "chrome/browser/sync/api/sync_data.h" |
6 | 6 |
7 #include <ostream> | 7 #include <ostream> |
8 | 8 |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 id_(id), | 49 id_(id), |
50 immutable_entity_(entity) {} | 50 immutable_entity_(entity) {} |
51 | 51 |
52 SyncData::~SyncData() {} | 52 SyncData::~SyncData() {} |
53 | 53 |
54 // Static. | 54 // Static. |
55 SyncData SyncData::CreateLocalDelete( | 55 SyncData SyncData::CreateLocalDelete( |
56 const std::string& sync_tag, | 56 const std::string& sync_tag, |
57 syncable::ModelType datatype) { | 57 syncable::ModelType datatype) { |
58 sync_pb::EntitySpecifics specifics; | 58 sync_pb::EntitySpecifics specifics; |
59 syncable::AddDefaultExtensionValue(datatype, &specifics); | 59 syncable::AddDefaultFieldValue(datatype, &specifics); |
60 return CreateLocalData(sync_tag, "", specifics); | 60 return CreateLocalData(sync_tag, "", specifics); |
61 } | 61 } |
62 | 62 |
63 // Static. | 63 // Static. |
64 SyncData SyncData::CreateLocalData( | 64 SyncData SyncData::CreateLocalData( |
65 const std::string& sync_tag, | 65 const std::string& sync_tag, |
66 const std::string& non_unique_title, | 66 const std::string& non_unique_title, |
67 const sync_pb::EntitySpecifics& specifics) { | 67 const sync_pb::EntitySpecifics& specifics) { |
68 sync_pb::SyncEntity entity; | 68 sync_pb::SyncEntity entity; |
69 entity.set_client_defined_unique_tag(sync_tag); | 69 entity.set_client_defined_unique_tag(sync_tag); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 } | 129 } |
130 | 130 |
131 std::string id = base::Int64ToString(GetRemoteId()); | 131 std::string id = base::Int64ToString(GetRemoteId()); |
132 return "{ isLocal: false, type: " + type + ", specifics: " + specifics + | 132 return "{ isLocal: false, type: " + type + ", specifics: " + specifics + |
133 ", id: " + id + "}"; | 133 ", id: " + id + "}"; |
134 } | 134 } |
135 | 135 |
136 void PrintTo(const SyncData& sync_data, std::ostream* os) { | 136 void PrintTo(const SyncData& sync_data, std::ostream* os) { |
137 *os << sync_data.ToString(); | 137 *os << sync_data.ToString(); |
138 } | 138 } |
OLD | NEW |