| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "sync/internal_api/public/write_node.h" | 5 #include "sync/internal_api/public/write_node.h" |
| 6 | 6 |
| 7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "base/values.h" | 8 #include "base/values.h" |
| 9 #include "sync/internal_api/public/base_transaction.h" | 9 #include "sync/internal_api/public/base_transaction.h" |
| 10 #include "sync/internal_api/public/write_transaction.h" | 10 #include "sync/internal_api/public/write_transaction.h" |
| 11 #include "sync/internal_api/syncapi_internal.h" | 11 #include "sync/internal_api/syncapi_internal.h" |
| 12 #include "sync/protocol/app_specifics.pb.h" | 12 #include "sync/protocol/app_specifics.pb.h" |
| 13 #include "sync/protocol/autofill_specifics.pb.h" | 13 #include "sync/protocol/autofill_specifics.pb.h" |
| 14 #include "sync/protocol/bookmark_specifics.pb.h" | 14 #include "sync/protocol/bookmark_specifics.pb.h" |
| 15 #include "sync/protocol/extension_specifics.pb.h" | 15 #include "sync/protocol/extension_specifics.pb.h" |
| 16 #include "sync/protocol/password_specifics.pb.h" | 16 #include "sync/protocol/password_specifics.pb.h" |
| 17 #include "sync/protocol/session_specifics.pb.h" | 17 #include "sync/protocol/session_specifics.pb.h" |
| 18 #include "sync/protocol/theme_specifics.pb.h" | 18 #include "sync/protocol/theme_specifics.pb.h" |
| 19 #include "sync/protocol/typed_url_specifics.pb.h" | 19 #include "sync/protocol/typed_url_specifics.pb.h" |
| 20 #include "sync/syncable/mutable_entry.h" | 20 #include "sync/syncable/mutable_entry.h" |
| 21 #include "sync/syncable/nigori_util.h" | 21 #include "sync/syncable/nigori_util.h" |
| 22 #include "sync/util/cryptographer.h" | 22 #include "sync/util/cryptographer.h" |
| 23 | 23 |
| 24 using syncer::Cryptographer; | |
| 25 using std::string; | 24 using std::string; |
| 26 using std::vector; | 25 using std::vector; |
| 26 |
| 27 namespace syncer { |
| 28 |
| 27 using syncable::kEncryptedString; | 29 using syncable::kEncryptedString; |
| 28 using syncable::SPECIFICS; | 30 using syncable::SPECIFICS; |
| 29 | 31 |
| 30 namespace syncer { | |
| 31 | |
| 32 static const char kDefaultNameForNewNodes[] = " "; | 32 static const char kDefaultNameForNewNodes[] = " "; |
| 33 | 33 |
| 34 void WriteNode::SetIsFolder(bool folder) { | 34 void WriteNode::SetIsFolder(bool folder) { |
| 35 if (entry_->Get(syncable::IS_DIR) == folder) | 35 if (entry_->Get(syncable::IS_DIR) == folder) |
| 36 return; // Skip redundant changes. | 36 return; // Skip redundant changes. |
| 37 | 37 |
| 38 entry_->Put(syncable::IS_DIR, folder); | 38 entry_->Put(syncable::IS_DIR, folder); |
| 39 MarkForSyncing(); | 39 MarkForSyncing(); |
| 40 } | 40 } |
| 41 | 41 |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 sync_pb::BookmarkSpecifics new_value = GetBookmarkSpecifics(); | 503 sync_pb::BookmarkSpecifics new_value = GetBookmarkSpecifics(); |
| 504 new_value.set_favicon(bytes.empty() ? NULL : &bytes[0], bytes.size()); | 504 new_value.set_favicon(bytes.empty() ? NULL : &bytes[0], bytes.size()); |
| 505 SetBookmarkSpecifics(new_value); | 505 SetBookmarkSpecifics(new_value); |
| 506 } | 506 } |
| 507 | 507 |
| 508 void WriteNode::MarkForSyncing() { | 508 void WriteNode::MarkForSyncing() { |
| 509 syncable::MarkForSyncing(entry_); | 509 syncable::MarkForSyncing(entry_); |
| 510 } | 510 } |
| 511 | 511 |
| 512 } // namespace syncer | 512 } // namespace syncer |
| OLD | NEW |