OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/engine/syncapi.h" | 5 #include "chrome/browser/sync/engine/syncapi.h" |
6 | 6 |
7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
8 | 8 |
9 #include <iomanip> | 9 #include <iomanip> |
10 #include <list> | 10 #include <list> |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
239 return GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::autofill); | 239 return GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::autofill); |
240 } | 240 } |
241 | 241 |
242 const sync_pb::BookmarkSpecifics& BaseNode::GetBookmarkSpecifics() const { | 242 const sync_pb::BookmarkSpecifics& BaseNode::GetBookmarkSpecifics() const { |
243 DCHECK(GetModelType() == syncable::BOOKMARKS); | 243 DCHECK(GetModelType() == syncable::BOOKMARKS); |
244 return GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::bookmark); | 244 return GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::bookmark); |
245 } | 245 } |
246 | 246 |
247 bool BaseNode::GetPasswordSpecifics(sync_pb::PasswordSpecificsData* data) | 247 bool BaseNode::GetPasswordSpecifics(sync_pb::PasswordSpecificsData* data) |
248 const { | 248 const { |
249 DCHECK(GetModelType() == syncable::PASSWORD); | 249 DCHECK(GetModelType() == syncable::PASSWORDS); |
250 DCHECK(data); | 250 DCHECK(data); |
251 const sync_pb::PasswordSpecifics& specifics = | 251 const sync_pb::PasswordSpecifics& specifics = |
252 GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::password); | 252 GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::password); |
253 return data->ParseFromString(specifics.blob()); | 253 return data->ParseFromString(specifics.blob()); |
254 } | 254 } |
255 | 255 |
256 const sync_pb::PreferenceSpecifics& BaseNode::GetPreferenceSpecifics() const { | 256 const sync_pb::PreferenceSpecifics& BaseNode::GetPreferenceSpecifics() const { |
257 DCHECK(GetModelType() == syncable::PREFERENCES); | 257 DCHECK(GetModelType() == syncable::PREFERENCES); |
258 return GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::preference); | 258 return GetEntry()->Get(SPECIFICS).GetExtension(sync_pb::preference); |
259 } | 259 } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
322 | 322 |
323 void WriteNode::PutBookmarkSpecificsAndMarkForSyncing( | 323 void WriteNode::PutBookmarkSpecificsAndMarkForSyncing( |
324 const sync_pb::BookmarkSpecifics& new_value) { | 324 const sync_pb::BookmarkSpecifics& new_value) { |
325 sync_pb::EntitySpecifics entity_specifics; | 325 sync_pb::EntitySpecifics entity_specifics; |
326 entity_specifics.MutableExtension(sync_pb::bookmark)->CopyFrom(new_value); | 326 entity_specifics.MutableExtension(sync_pb::bookmark)->CopyFrom(new_value); |
327 PutSpecificsAndMarkForSyncing(entity_specifics); | 327 PutSpecificsAndMarkForSyncing(entity_specifics); |
328 } | 328 } |
329 | 329 |
330 void WriteNode::SetPasswordSpecifics( | 330 void WriteNode::SetPasswordSpecifics( |
331 const sync_pb::PasswordSpecificsData& data) { | 331 const sync_pb::PasswordSpecificsData& data) { |
332 DCHECK(GetModelType() == syncable::PASSWORD); | 332 DCHECK(GetModelType() == syncable::PASSWORDS); |
333 std::string serialized_data; | 333 std::string serialized_data; |
334 data.SerializeToString(&serialized_data); | 334 data.SerializeToString(&serialized_data); |
335 sync_pb::PasswordSpecifics new_value; | 335 sync_pb::PasswordSpecifics new_value; |
336 new_value.set_blob(serialized_data); | 336 new_value.set_blob(serialized_data); |
337 PutPasswordSpecificsAndMarkForSyncing(new_value); | 337 PutPasswordSpecificsAndMarkForSyncing(new_value); |
338 } | 338 } |
339 | 339 |
340 void WriteNode::SetPreferenceSpecifics( | 340 void WriteNode::SetPreferenceSpecifics( |
341 const sync_pb::PreferenceSpecifics& new_value) { | 341 const sync_pb::PreferenceSpecifics& new_value) { |
342 DCHECK(GetModelType() == syncable::PREFERENCES); | 342 DCHECK(GetModelType() == syncable::PREFERENCES); |
(...skipping 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1947 UserShare* SyncManager::GetUserShare() const { | 1947 UserShare* SyncManager::GetUserShare() const { |
1948 DCHECK(data_->initialized()) << "GetUserShare requires initialization!"; | 1948 DCHECK(data_->initialized()) << "GetUserShare requires initialization!"; |
1949 return data_->GetUserShare(); | 1949 return data_->GetUserShare(); |
1950 } | 1950 } |
1951 | 1951 |
1952 SyncManager::ExtraAutofillChangeRecordData::~ExtraAutofillChangeRecordData() { | 1952 SyncManager::ExtraAutofillChangeRecordData::~ExtraAutofillChangeRecordData() { |
1953 delete pre_deletion_data; | 1953 delete pre_deletion_data; |
1954 } | 1954 } |
1955 | 1955 |
1956 } // namespace sync_api | 1956 } // namespace sync_api |
OLD | NEW |