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 "components/sync/core/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 "components/sync/core/base_node.h" |
12 #include "sync/internal_api/public/read_node.h" | 12 #include "components/sync/core/read_node.h" |
13 #include "sync/protocol/proto_value_conversions.h" | 13 #include "components/sync/protocol/proto_value_conversions.h" |
14 | 14 |
15 namespace syncer { | 15 namespace syncer { |
16 | 16 |
17 ChangeRecord::ChangeRecord() | 17 ChangeRecord::ChangeRecord() : id(kInvalidId), action(ACTION_ADD) {} |
18 : id(kInvalidId), action(ACTION_ADD) {} | |
19 | 18 |
20 ChangeRecord::ChangeRecord(const ChangeRecord& other) = default; | 19 ChangeRecord::ChangeRecord(const ChangeRecord& other) = default; |
21 | 20 |
22 ChangeRecord::~ChangeRecord() {} | 21 ChangeRecord::~ChangeRecord() {} |
23 | 22 |
24 std::unique_ptr<base::DictionaryValue> ChangeRecord::ToValue() const { | 23 std::unique_ptr<base::DictionaryValue> ChangeRecord::ToValue() const { |
25 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); | 24 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); |
26 std::string action_str; | 25 std::string action_str; |
27 switch (action) { | 26 switch (action) { |
28 case ACTION_ADD: | 27 case ACTION_ADD: |
(...skipping 18 matching lines...) Expand all Loading... |
47 } | 46 } |
48 value->Set("specifics", EntitySpecificsToValue(specifics)); | 47 value->Set("specifics", EntitySpecificsToValue(specifics)); |
49 } | 48 } |
50 return value; | 49 return value; |
51 } | 50 } |
52 | 51 |
53 ExtraPasswordChangeRecordData::ExtraPasswordChangeRecordData() {} | 52 ExtraPasswordChangeRecordData::ExtraPasswordChangeRecordData() {} |
54 | 53 |
55 ExtraPasswordChangeRecordData::ExtraPasswordChangeRecordData( | 54 ExtraPasswordChangeRecordData::ExtraPasswordChangeRecordData( |
56 const sync_pb::PasswordSpecificsData& data) | 55 const sync_pb::PasswordSpecificsData& data) |
57 : unencrypted_(data) { | 56 : unencrypted_(data) {} |
58 } | |
59 | 57 |
60 ExtraPasswordChangeRecordData::~ExtraPasswordChangeRecordData() {} | 58 ExtraPasswordChangeRecordData::~ExtraPasswordChangeRecordData() {} |
61 | 59 |
62 std::unique_ptr<base::DictionaryValue> ExtraPasswordChangeRecordData::ToValue() | 60 std::unique_ptr<base::DictionaryValue> ExtraPasswordChangeRecordData::ToValue() |
63 const { | 61 const { |
64 return PasswordSpecificsDataToValue(unencrypted_); | 62 return PasswordSpecificsDataToValue(unencrypted_); |
65 } | 63 } |
66 | 64 |
67 const sync_pb::PasswordSpecificsData& | 65 const sync_pb::PasswordSpecificsData& |
68 ExtraPasswordChangeRecordData::unencrypted() const { | 66 ExtraPasswordChangeRecordData::unencrypted() const { |
69 return unencrypted_; | 67 return unencrypted_; |
70 } | 68 } |
71 | 69 |
72 } // namespace syncer | 70 } // namespace syncer |
OLD | NEW |