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 // Keep this file in sync with the .proto files in this directory. | 5 // Keep this file in sync with the .proto files in this directory. |
6 | 6 |
7 #ifndef SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 7 #ifndef SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ |
8 #define SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 8 #define SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ |
9 | 9 |
10 namespace base { | 10 namespace base { |
11 class DictionaryValue; | 11 class DictionaryValue; |
12 } | 12 } |
13 | 13 |
14 namespace sync_pb { | 14 namespace sync_pb { |
15 class AppNotification; | 15 class AppNotification; |
16 class AppNotificationSettings; | 16 class AppNotificationSettings; |
17 class AppSettingSpecifics; | 17 class AppSettingSpecifics; |
18 class AppSpecifics; | 18 class AppSpecifics; |
19 class AutofillProfileSpecifics; | 19 class AutofillProfileSpecifics; |
20 class AutofillSpecifics; | 20 class AutofillSpecifics; |
21 class BookmarkSpecifics; | 21 class BookmarkSpecifics; |
22 class ClientToServerMessage; | 22 class ClientToServerMessage; |
23 class ClientToServerResponse; | 23 class ClientToServerResponse; |
24 class DeviceInfoSpecifics; | 24 class DeviceInfoSpecifics; |
25 class DeviceInformation; | 25 class DeviceInformation; |
26 class EncryptedData; | 26 class EncryptedData; |
27 class EntitySpecifics; | 27 class EntitySpecifics; |
| 28 class EverythingDirective; |
28 class ExtensionSettingSpecifics; | 29 class ExtensionSettingSpecifics; |
29 class ExtensionSpecifics; | 30 class ExtensionSpecifics; |
| 31 class GlobalIdDirective; |
| 32 class HistoryDeleteDirectiveSpecifics; |
30 class NigoriSpecifics; | 33 class NigoriSpecifics; |
31 class PasswordSpecifics; | 34 class PasswordSpecifics; |
32 class PasswordSpecificsData; | 35 class PasswordSpecificsData; |
33 class PreferenceSpecifics; | 36 class PreferenceSpecifics; |
34 class SearchEngineSpecifics; | 37 class SearchEngineSpecifics; |
35 class SessionHeader; | 38 class SessionHeader; |
36 class SessionSpecifics; | 39 class SessionSpecifics; |
37 class SessionTab; | 40 class SessionTab; |
38 class SessionWindow; | 41 class SessionWindow; |
39 class TabNavigation; | 42 class TabNavigation; |
40 class ThemeSpecifics; | 43 class ThemeSpecifics; |
| 44 class TimeRangeDirective; |
41 class TypedUrlSpecifics; | 45 class TypedUrlSpecifics; |
42 } // namespace sync_pb | 46 } // namespace sync_pb |
43 | 47 |
44 // Utility functions to convert sync protocol buffers to dictionaries. | 48 // Utility functions to convert sync protocol buffers to dictionaries. |
45 // Each protocol field is mapped to a key of the same name. Repeated | 49 // Each protocol field is mapped to a key of the same name. Repeated |
46 // fields are mapped to array values and sub-messages are mapped to | 50 // fields are mapped to array values and sub-messages are mapped to |
47 // sub-dictionary values. | 51 // sub-dictionary values. |
48 // | 52 // |
49 // TODO(akalin): Add has_* information. | 53 // TODO(akalin): Add has_* information. |
50 // | 54 // |
(...skipping 24 matching lines...) Expand all Loading... |
75 const sync_pb::SessionWindow& session_window); | 79 const sync_pb::SessionWindow& session_window); |
76 | 80 |
77 base::DictionaryValue* TabNavigationToValue( | 81 base::DictionaryValue* TabNavigationToValue( |
78 const sync_pb::TabNavigation& tab_navigation); | 82 const sync_pb::TabNavigation& tab_navigation); |
79 | 83 |
80 // Sub-protocol of PasswordSpecifics. | 84 // Sub-protocol of PasswordSpecifics. |
81 | 85 |
82 base::DictionaryValue* PasswordSpecificsDataToValue( | 86 base::DictionaryValue* PasswordSpecificsDataToValue( |
83 const sync_pb::PasswordSpecificsData& password_specifics_data); | 87 const sync_pb::PasswordSpecificsData& password_specifics_data); |
84 | 88 |
| 89 // Sub-protocol of NigoriSpecifics. |
| 90 |
| 91 base::DictionaryValue* DeviceInformationToValue( |
| 92 const sync_pb::DeviceInformation& device_information); |
| 93 |
| 94 // Sub-protocol of HistoryDeleteDirectiveSpecifics. |
| 95 |
| 96 base::DictionaryValue* GlobalIdDirectiveToValue( |
| 97 const sync_pb::GlobalIdDirective& global_id_directive); |
| 98 |
| 99 base::DictionaryValue* TimeRangeDirectiveToValue( |
| 100 const sync_pb::TimeRangeDirective& time_range_directive); |
| 101 |
85 // Main *SpecificsToValue functions. | 102 // Main *SpecificsToValue functions. |
86 | 103 |
87 base::DictionaryValue* AppNotificationToValue( | 104 base::DictionaryValue* AppNotificationToValue( |
88 const sync_pb::AppNotification& app_notification_specifics); | 105 const sync_pb::AppNotification& app_notification_specifics); |
89 | 106 |
90 base::DictionaryValue* AppSettingSpecificsToValue( | 107 base::DictionaryValue* AppSettingSpecificsToValue( |
91 const sync_pb::AppSettingSpecifics& app_setting_specifics); | 108 const sync_pb::AppSettingSpecifics& app_setting_specifics); |
92 | 109 |
93 base::DictionaryValue* AppSpecificsToValue( | 110 base::DictionaryValue* AppSpecificsToValue( |
94 const sync_pb::AppSpecifics& app_specifics); | 111 const sync_pb::AppSpecifics& app_specifics); |
95 | 112 |
96 base::DictionaryValue* AutofillSpecificsToValue( | 113 base::DictionaryValue* AutofillSpecificsToValue( |
97 const sync_pb::AutofillSpecifics& autofill_specifics); | 114 const sync_pb::AutofillSpecifics& autofill_specifics); |
98 | 115 |
99 base::DictionaryValue* AutofillProfileSpecificsToValue( | 116 base::DictionaryValue* AutofillProfileSpecificsToValue( |
100 const sync_pb::AutofillProfileSpecifics& autofill_profile_specifics); | 117 const sync_pb::AutofillProfileSpecifics& autofill_profile_specifics); |
101 | 118 |
102 base::DictionaryValue* BookmarkSpecificsToValue( | 119 base::DictionaryValue* BookmarkSpecificsToValue( |
103 const sync_pb::BookmarkSpecifics& bookmark_specifics); | 120 const sync_pb::BookmarkSpecifics& bookmark_specifics); |
104 | 121 |
105 base::DictionaryValue* ExtensionSettingSpecificsToValue( | 122 base::DictionaryValue* ExtensionSettingSpecificsToValue( |
106 const sync_pb::ExtensionSettingSpecifics& extension_setting_specifics); | 123 const sync_pb::ExtensionSettingSpecifics& extension_setting_specifics); |
107 | 124 |
108 base::DictionaryValue* ExtensionSpecificsToValue( | 125 base::DictionaryValue* ExtensionSpecificsToValue( |
109 const sync_pb::ExtensionSpecifics& extension_specifics); | 126 const sync_pb::ExtensionSpecifics& extension_specifics); |
110 | 127 |
| 128 base::DictionaryValue* HistoryDeleteDirectiveSpecificsToValue( |
| 129 const sync_pb::HistoryDeleteDirectiveSpecifics& |
| 130 history_delete_directive_specifics); |
| 131 |
111 base::DictionaryValue* NigoriSpecificsToValue( | 132 base::DictionaryValue* NigoriSpecificsToValue( |
112 const sync_pb::NigoriSpecifics& nigori_specifics); | 133 const sync_pb::NigoriSpecifics& nigori_specifics); |
113 | 134 |
114 base::DictionaryValue* PasswordSpecificsToValue( | 135 base::DictionaryValue* PasswordSpecificsToValue( |
115 const sync_pb::PasswordSpecifics& password_specifics); | 136 const sync_pb::PasswordSpecifics& password_specifics); |
116 | 137 |
117 base::DictionaryValue* DeviceInfoSpecificsToValue( | 138 base::DictionaryValue* DeviceInfoSpecificsToValue( |
118 const sync_pb::DeviceInfoSpecifics& device_info_specifics); | 139 const sync_pb::DeviceInfoSpecifics& device_info_specifics); |
119 | 140 |
120 base::DictionaryValue* PreferenceSpecificsToValue( | 141 base::DictionaryValue* PreferenceSpecificsToValue( |
(...skipping 21 matching lines...) Expand all Loading... |
142 bool include_specifics); | 163 bool include_specifics); |
143 | 164 |
144 base::DictionaryValue* ClientToServerResponseToValue( | 165 base::DictionaryValue* ClientToServerResponseToValue( |
145 const sync_pb::ClientToServerResponse& proto, | 166 const sync_pb::ClientToServerResponse& proto, |
146 bool include_specifics); | 167 bool include_specifics); |
147 | 168 |
148 | 169 |
149 } // namespace syncer | 170 } // namespace syncer |
150 | 171 |
151 #endif // SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 172 #endif // SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ |
OLD | NEW |