| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef COMPONENTS_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 5 #ifndef COMPONENTS_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ |
| 6 #define COMPONENTS_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 6 #define COMPONENTS_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 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 AppListSpecifics; | 15 class AppListSpecifics; |
| 16 class AppNotification; | 16 class AppNotification; |
| 17 class AppNotificationSettings; | 17 class AppNotificationSettings; |
| 18 class AppSettingSpecifics; | 18 class AppSettingSpecifics; |
| 19 class AppSpecifics; | 19 class AppSpecifics; |
| 20 class ArcPackageSpecifics; | 20 class ArcPackageSpecifics; |
| 21 class ArticleSpecifics; | 21 class ArticleSpecifics; |
| 22 class AttachmentIdProto; | 22 class AttachmentIdProto; |
| 23 class AutofillProfileSpecifics; | 23 class AutofillProfileSpecifics; |
| 24 class AutofillSpecifics; | 24 class AutofillSpecifics; |
| 25 class AutofillWalletSpecifics; | 25 class AutofillWalletSpecifics; |
| 26 class BookmarkSpecifics; | 26 class BookmarkSpecifics; |
| 27 class ClientConfigParams; | 27 class ClientConfigParams; |
| 28 class ClientToServerMessage; | 28 class ClientToServerMessage; |
| 29 class ClientToServerResponse; | 29 class ClientToServerResponse; |
| 30 class CollapsedInfo; | |
| 31 class DatatypeAssociationStats; | 30 class DatatypeAssociationStats; |
| 32 class DebugEventInfo; | 31 class DebugEventInfo; |
| 33 class DebugInfo; | 32 class DebugInfo; |
| 34 class DeviceInfoSpecifics; | 33 class DeviceInfoSpecifics; |
| 35 class DeviceInformation; | |
| 36 class DictionarySpecifics; | 34 class DictionarySpecifics; |
| 37 class EncryptedData; | 35 class EncryptedData; |
| 38 class EntityMetadata; | 36 class EntityMetadata; |
| 39 class EntitySpecifics; | 37 class EntitySpecifics; |
| 40 class EverythingDirective; | |
| 41 class ExperimentsSpecifics; | 38 class ExperimentsSpecifics; |
| 42 class ExtensionSettingSpecifics; | 39 class ExtensionSettingSpecifics; |
| 43 class ExtensionSpecifics; | 40 class ExtensionSpecifics; |
| 44 class FaviconImageSpecifics; | 41 class FaviconImageSpecifics; |
| 45 class FaviconTrackingSpecifics; | 42 class FaviconTrackingSpecifics; |
| 46 class GlobalIdDirective; | 43 class GlobalIdDirective; |
| 47 class HistoryDeleteDirectiveSpecifics; | 44 class HistoryDeleteDirectiveSpecifics; |
| 48 class KeystoreEncryptionFlagsSpecifics; | |
| 49 class LinkedAppIconInfo; | 45 class LinkedAppIconInfo; |
| 50 class ManagedUserSettingSpecifics; | 46 class ManagedUserSettingSpecifics; |
| 51 class ManagedUserSharedSettingSpecifics; | 47 class ManagedUserSharedSettingSpecifics; |
| 52 class ManagedUserSpecifics; | 48 class ManagedUserSpecifics; |
| 53 class ManagedUserWhitelistSpecifics; | 49 class ManagedUserWhitelistSpecifics; |
| 54 class Media; | |
| 55 class NavigationRedirect; | 50 class NavigationRedirect; |
| 56 class NigoriSpecifics; | 51 class NigoriSpecifics; |
| 57 class PasswordSpecifics; | 52 class PasswordSpecifics; |
| 58 class PasswordSpecificsData; | 53 class PasswordSpecificsData; |
| 59 class PreferenceSpecifics; | 54 class PreferenceSpecifics; |
| 60 class PriorityPreferenceSpecifics; | 55 class PriorityPreferenceSpecifics; |
| 61 class PrinterPPDReference; | 56 class PrinterPPDReference; |
| 62 class PrinterSpecifics; | 57 class PrinterSpecifics; |
| 63 class ReadingListSpecifics; | 58 class ReadingListSpecifics; |
| 64 class SearchEngineSpecifics; | 59 class SearchEngineSpecifics; |
| 65 class SessionHeader; | 60 class SessionHeader; |
| 66 class SessionSpecifics; | 61 class SessionSpecifics; |
| 67 class SessionTab; | 62 class SessionTab; |
| 68 class SessionWindow; | 63 class SessionWindow; |
| 69 class SimpleCollapsedLayout; | |
| 70 class SyncCycleCompletedEventInfo; | 64 class SyncCycleCompletedEventInfo; |
| 71 class SyncEntity; | 65 class SyncEntity; |
| 72 class SyncedNotificationAppInfoSpecifics; | 66 class SyncedNotificationAppInfoSpecifics; |
| 73 class SyncedNotificationSpecifics; | 67 class SyncedNotificationSpecifics; |
| 74 class TabNavigation; | 68 class TabNavigation; |
| 75 class Target; | |
| 76 class ThemeSpecifics; | 69 class ThemeSpecifics; |
| 77 class TimeRangeDirective; | 70 class TimeRangeDirective; |
| 78 class TypedUrlSpecifics; | 71 class TypedUrlSpecifics; |
| 79 class WalletMaskedCreditCard; | 72 class WalletMaskedCreditCard; |
| 80 class WalletMetadataSpecifics; | 73 class WalletMetadataSpecifics; |
| 81 class WalletPostalAddress; | 74 class WalletPostalAddress; |
| 82 class WifiCredentialSpecifics; | 75 class WifiCredentialSpecifics; |
| 83 } // namespace sync_pb | 76 } // namespace sync_pb |
| 84 | 77 |
| 85 // Keep this file in sync with the .proto files in this directory. | 78 // Keep this file in sync with the .proto files in this directory. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 100 | 93 |
| 101 // TODO(akalin): Perhaps extend this to decrypt? | 94 // TODO(akalin): Perhaps extend this to decrypt? |
| 102 std::unique_ptr<base::DictionaryValue> EncryptedDataToValue( | 95 std::unique_ptr<base::DictionaryValue> EncryptedDataToValue( |
| 103 const sync_pb::EncryptedData& encrypted_data); | 96 const sync_pb::EncryptedData& encrypted_data); |
| 104 | 97 |
| 105 // Sub-protocol of AppListSpecifics. | 98 // Sub-protocol of AppListSpecifics. |
| 106 std::unique_ptr<base::DictionaryValue> AppListSpecificsToValue( | 99 std::unique_ptr<base::DictionaryValue> AppListSpecificsToValue( |
| 107 const sync_pb::AppListSpecifics& proto); | 100 const sync_pb::AppListSpecifics& proto); |
| 108 | 101 |
| 109 // Sub-protocols of AppSpecifics. | 102 // Sub-protocols of AppSpecifics. |
| 110 std::unique_ptr<base::DictionaryValue> AppSettingsToValue( | 103 std::unique_ptr<base::DictionaryValue> AppNotificationSettingsToValue( |
| 111 const sync_pb::AppNotificationSettings& app_notification_settings); | 104 const sync_pb::AppNotificationSettings& app_notification_settings); |
| 112 | 105 |
| 113 std::unique_ptr<base::DictionaryValue> LinkedAppIconInfoToValue( | 106 std::unique_ptr<base::DictionaryValue> LinkedAppIconInfoToValue( |
| 114 const sync_pb::LinkedAppIconInfo& linked_app_icon_info); | 107 const sync_pb::LinkedAppIconInfo& linked_app_icon_info); |
| 115 | 108 |
| 116 // Sub-protocol of ArcPackageSpecifics. | 109 // Sub-protocol of ArcPackageSpecifics. |
| 117 std::unique_ptr<base::DictionaryValue> ArcPackageSpecificsToValue( | 110 std::unique_ptr<base::DictionaryValue> ArcPackageSpecificsToValue( |
| 118 const sync_pb::ArcPackageSpecifics& proto); | 111 const sync_pb::ArcPackageSpecifics& proto); |
| 119 | 112 |
| 120 // Sub-protocols of SessionSpecifics. | 113 // Sub-protocols of SessionSpecifics. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 132 const sync_pb::TabNavigation& tab_navigation); | 125 const sync_pb::TabNavigation& tab_navigation); |
| 133 | 126 |
| 134 std::unique_ptr<base::DictionaryValue> NavigationRedirectToValue( | 127 std::unique_ptr<base::DictionaryValue> NavigationRedirectToValue( |
| 135 const sync_pb::NavigationRedirect& navigation_redirect); | 128 const sync_pb::NavigationRedirect& navigation_redirect); |
| 136 | 129 |
| 137 // Sub-protocol of PasswordSpecifics. | 130 // Sub-protocol of PasswordSpecifics. |
| 138 | 131 |
| 139 std::unique_ptr<base::DictionaryValue> PasswordSpecificsDataToValue( | 132 std::unique_ptr<base::DictionaryValue> PasswordSpecificsDataToValue( |
| 140 const sync_pb::PasswordSpecificsData& password_specifics_data); | 133 const sync_pb::PasswordSpecificsData& password_specifics_data); |
| 141 | 134 |
| 142 // Sub-protocol of NigoriSpecifics. | |
| 143 | |
| 144 std::unique_ptr<base::DictionaryValue> DeviceInformationToValue( | |
| 145 const sync_pb::DeviceInformation& device_information); | |
| 146 | |
| 147 // Sub-protocol of HistoryDeleteDirectiveSpecifics. | 135 // Sub-protocol of HistoryDeleteDirectiveSpecifics. |
| 148 | 136 |
| 149 std::unique_ptr<base::DictionaryValue> GlobalIdDirectiveToValue( | 137 std::unique_ptr<base::DictionaryValue> GlobalIdDirectiveToValue( |
| 150 const sync_pb::GlobalIdDirective& global_id_directive); | 138 const sync_pb::GlobalIdDirective& global_id_directive); |
| 151 | 139 |
| 152 std::unique_ptr<base::DictionaryValue> TimeRangeDirectiveToValue( | 140 std::unique_ptr<base::DictionaryValue> TimeRangeDirectiveToValue( |
| 153 const sync_pb::TimeRangeDirective& time_range_directive); | 141 const sync_pb::TimeRangeDirective& time_range_directive); |
| 154 | 142 |
| 155 // Sub-protocol of Experiments. | 143 // Sub-protocol of Experiments. |
| 156 | 144 |
| 157 std::unique_ptr<base::DictionaryValue> KeystoreEncryptionToValue( | |
| 158 const sync_pb::KeystoreEncryptionFlagsSpecifics& proto); | |
| 159 | |
| 160 std::unique_ptr<base::DictionaryValue> SessionSpecificsToValue( | 145 std::unique_ptr<base::DictionaryValue> SessionSpecificsToValue( |
| 161 const sync_pb::SessionSpecifics& session_specifics); | 146 const sync_pb::SessionSpecifics& session_specifics); |
| 162 | 147 |
| 163 // Sub-protocol of PrinterSpecifics. | 148 // Sub-protocol of PrinterSpecifics. |
| 164 | 149 |
| 165 std::unique_ptr<base::DictionaryValue> PrinterPPDReferenceToValue( | 150 std::unique_ptr<base::DictionaryValue> PrinterPPDReferenceToValue( |
| 166 const sync_pb::PrinterPPDReference& proto); | 151 const sync_pb::PrinterPPDReference& proto); |
| 167 | 152 |
| 168 // Main *SpecificsToValue functions. | 153 // Main *SpecificsToValue functions. |
| 169 | 154 |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 const sync_pb::ManagedUserSpecifics& managed_user_specifics); | 214 const sync_pb::ManagedUserSpecifics& managed_user_specifics); |
| 230 | 215 |
| 231 std::unique_ptr<base::DictionaryValue> ManagedUserSharedSettingSpecificsToValue( | 216 std::unique_ptr<base::DictionaryValue> ManagedUserSharedSettingSpecificsToValue( |
| 232 const sync_pb::ManagedUserSharedSettingSpecifics& | 217 const sync_pb::ManagedUserSharedSettingSpecifics& |
| 233 managed_user_shared_setting_specifics); | 218 managed_user_shared_setting_specifics); |
| 234 | 219 |
| 235 std::unique_ptr<base::DictionaryValue> ManagedUserWhitelistSpecificsToValue( | 220 std::unique_ptr<base::DictionaryValue> ManagedUserWhitelistSpecificsToValue( |
| 236 const sync_pb::ManagedUserWhitelistSpecifics& | 221 const sync_pb::ManagedUserWhitelistSpecifics& |
| 237 managed_user_whitelist_specifics); | 222 managed_user_whitelist_specifics); |
| 238 | 223 |
| 239 std::unique_ptr<base::DictionaryValue> MediaToValue( | |
| 240 const sync_pb::Media& media); | |
| 241 | |
| 242 std::unique_ptr<base::DictionaryValue> NigoriSpecificsToValue( | 224 std::unique_ptr<base::DictionaryValue> NigoriSpecificsToValue( |
| 243 const sync_pb::NigoriSpecifics& nigori_specifics); | 225 const sync_pb::NigoriSpecifics& nigori_specifics); |
| 244 | 226 |
| 245 std::unique_ptr<base::DictionaryValue> PasswordSpecificsToValue( | 227 std::unique_ptr<base::DictionaryValue> PasswordSpecificsToValue( |
| 246 const sync_pb::PasswordSpecifics& password_specifics); | 228 const sync_pb::PasswordSpecifics& password_specifics); |
| 247 | 229 |
| 248 std::unique_ptr<base::DictionaryValue> PreferenceSpecificsToValue( | 230 std::unique_ptr<base::DictionaryValue> PreferenceSpecificsToValue( |
| 249 const sync_pb::PreferenceSpecifics& password_specifics); | 231 const sync_pb::PreferenceSpecifics& password_specifics); |
| 250 | 232 |
| 251 std::unique_ptr<base::DictionaryValue> PrinterSpecificsToValue( | 233 std::unique_ptr<base::DictionaryValue> PrinterSpecificsToValue( |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 | 297 |
| 316 std::unique_ptr<base::DictionaryValue> AttachmentIdProtoToValue( | 298 std::unique_ptr<base::DictionaryValue> AttachmentIdProtoToValue( |
| 317 const sync_pb::AttachmentIdProto& proto); | 299 const sync_pb::AttachmentIdProto& proto); |
| 318 | 300 |
| 319 std::unique_ptr<base::DictionaryValue> EntityMetadataToValue( | 301 std::unique_ptr<base::DictionaryValue> EntityMetadataToValue( |
| 320 const sync_pb::EntityMetadata& metadata); | 302 const sync_pb::EntityMetadata& metadata); |
| 321 | 303 |
| 322 } // namespace syncer | 304 } // namespace syncer |
| 323 | 305 |
| 324 #endif // COMPONENTS_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 306 #endif // COMPONENTS_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ |
| OLD | NEW |