| 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/change_record.h" | 5 #include "sync/internal_api/public/change_record.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 #include "sync/internal_api/public/base_node.h" | 11 #include "sync/internal_api/public/base_node.h" |
| 12 #include "sync/internal_api/public/read_node.h" | 12 #include "sync/internal_api/public/read_node.h" |
| 13 #include "sync/protocol/proto_value_conversions.h" | 13 #include "sync/protocol/proto_value_conversions.h" |
| 14 | 14 |
| 15 namespace syncer { | 15 namespace syncer { |
| 16 | 16 |
| 17 ChangeRecord::ChangeRecord() | 17 ChangeRecord::ChangeRecord() |
| 18 : id(kInvalidId), action(ACTION_ADD) {} | 18 : id(kInvalidId), action(ACTION_ADD) {} |
| 19 | 19 |
| 20 ChangeRecord::ChangeRecord(const ChangeRecord& other) = default; | 20 ChangeRecord::ChangeRecord(const ChangeRecord& other) = default; |
| 21 | 21 |
| 22 ChangeRecord::~ChangeRecord() {} | 22 ChangeRecord::~ChangeRecord() {} |
| 23 | 23 |
| 24 scoped_ptr<base::DictionaryValue> ChangeRecord::ToValue() const { | 24 std::unique_ptr<base::DictionaryValue> ChangeRecord::ToValue() const { |
| 25 scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue()); | 25 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
| 26 std::string action_str; | 26 std::string action_str; |
| 27 switch (action) { | 27 switch (action) { |
| 28 case ACTION_ADD: | 28 case ACTION_ADD: |
| 29 action_str = "Add"; | 29 action_str = "Add"; |
| 30 break; | 30 break; |
| 31 case ACTION_DELETE: | 31 case ACTION_DELETE: |
| 32 action_str = "Delete"; | 32 action_str = "Delete"; |
| 33 break; | 33 break; |
| 34 case ACTION_UPDATE: | 34 case ACTION_UPDATE: |
| 35 action_str = "Update"; | 35 action_str = "Update"; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 52 | 52 |
| 53 ExtraPasswordChangeRecordData::ExtraPasswordChangeRecordData() {} | 53 ExtraPasswordChangeRecordData::ExtraPasswordChangeRecordData() {} |
| 54 | 54 |
| 55 ExtraPasswordChangeRecordData::ExtraPasswordChangeRecordData( | 55 ExtraPasswordChangeRecordData::ExtraPasswordChangeRecordData( |
| 56 const sync_pb::PasswordSpecificsData& data) | 56 const sync_pb::PasswordSpecificsData& data) |
| 57 : unencrypted_(data) { | 57 : unencrypted_(data) { |
| 58 } | 58 } |
| 59 | 59 |
| 60 ExtraPasswordChangeRecordData::~ExtraPasswordChangeRecordData() {} | 60 ExtraPasswordChangeRecordData::~ExtraPasswordChangeRecordData() {} |
| 61 | 61 |
| 62 scoped_ptr<base::DictionaryValue> ExtraPasswordChangeRecordData::ToValue() | 62 std::unique_ptr<base::DictionaryValue> ExtraPasswordChangeRecordData::ToValue() |
| 63 const { | 63 const { |
| 64 return PasswordSpecificsDataToValue(unencrypted_); | 64 return PasswordSpecificsDataToValue(unencrypted_); |
| 65 } | 65 } |
| 66 | 66 |
| 67 const sync_pb::PasswordSpecificsData& | 67 const sync_pb::PasswordSpecificsData& |
| 68 ExtraPasswordChangeRecordData::unencrypted() const { | 68 ExtraPasswordChangeRecordData::unencrypted() const { |
| 69 return unencrypted_; | 69 return unencrypted_; |
| 70 } | 70 } |
| 71 | 71 |
| 72 } // namespace syncer | 72 } // namespace syncer |
| OLD | NEW |