| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 7 #ifndef CHROME_BROWSER_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ |
| 8 #define CHROME_BROWSER_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 8 #define CHROME_BROWSER_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ |
| 9 #pragma once | 9 #pragma once |
| 10 | 10 |
| 11 namespace base { |
| 11 class DictionaryValue; | 12 class DictionaryValue; |
| 13 } |
| 12 | 14 |
| 13 namespace sync_pb { | 15 namespace sync_pb { |
| 14 class AppSpecifics; | 16 class AppSpecifics; |
| 15 class AutofillCreditCardSpecifics; | 17 class AutofillCreditCardSpecifics; |
| 16 class AutofillProfileSpecifics; | 18 class AutofillProfileSpecifics; |
| 17 class AutofillSpecifics; | 19 class AutofillSpecifics; |
| 18 class BookmarkSpecifics; | 20 class BookmarkSpecifics; |
| 19 class EncryptedData; | 21 class EncryptedData; |
| 20 class EntitySpecifics; | 22 class EntitySpecifics; |
| 21 class ExtensionSpecifics; | 23 class ExtensionSpecifics; |
| (...skipping 19 matching lines...) Expand all Loading... |
| 41 // TODO(akalin): Add has_* information. | 43 // TODO(akalin): Add has_* information. |
| 42 // | 44 // |
| 43 // TODO(akalin): Improve enum support. | 45 // TODO(akalin): Improve enum support. |
| 44 | 46 |
| 45 namespace browser_sync { | 47 namespace browser_sync { |
| 46 | 48 |
| 47 // Ownership of all returned DictionaryValues are transferred to the | 49 // Ownership of all returned DictionaryValues are transferred to the |
| 48 // caller. | 50 // caller. |
| 49 | 51 |
| 50 // TODO(akalin): Perhaps extend this to decrypt? | 52 // TODO(akalin): Perhaps extend this to decrypt? |
| 51 DictionaryValue* EncryptedDataToValue( | 53 base::DictionaryValue* EncryptedDataToValue( |
| 52 const sync_pb::EncryptedData& encrypted_data); | 54 const sync_pb::EncryptedData& encrypted_data); |
| 53 | 55 |
| 54 // Sub-protocols of SessionSpecifics. | 56 // Sub-protocols of SessionSpecifics. |
| 55 | 57 |
| 56 DictionaryValue* SessionHeaderToValue( | 58 base::DictionaryValue* SessionHeaderToValue( |
| 57 const sync_pb::SessionHeader& session_header); | 59 const sync_pb::SessionHeader& session_header); |
| 58 | 60 |
| 59 DictionaryValue* SessionTabToValue( | 61 base::DictionaryValue* SessionTabToValue( |
| 60 const sync_pb::SessionTab& session_tab); | 62 const sync_pb::SessionTab& session_tab); |
| 61 | 63 |
| 62 DictionaryValue* SessionWindowToValue( | 64 base::DictionaryValue* SessionWindowToValue( |
| 63 const sync_pb::SessionWindow& session_window); | 65 const sync_pb::SessionWindow& session_window); |
| 64 | 66 |
| 65 DictionaryValue* TabNavigationToValue( | 67 base::DictionaryValue* TabNavigationToValue( |
| 66 const sync_pb::TabNavigation& tab_navigation); | 68 const sync_pb::TabNavigation& tab_navigation); |
| 67 | 69 |
| 68 // Sub-protocol of PasswordSpecifics. | 70 // Sub-protocol of PasswordSpecifics. |
| 69 | 71 |
| 70 DictionaryValue* PasswordSpecificsDataToValue( | 72 base::DictionaryValue* PasswordSpecificsDataToValue( |
| 71 const sync_pb::PasswordSpecificsData& password_specifics_data); | 73 const sync_pb::PasswordSpecificsData& password_specifics_data); |
| 72 | 74 |
| 73 // Main *SpecificsToValue functions. | 75 // Main *SpecificsToValue functions. |
| 74 | 76 |
| 75 DictionaryValue* AppSpecificsToValue( | 77 base::DictionaryValue* AppSpecificsToValue( |
| 76 const sync_pb::AppSpecifics& app_specifics); | 78 const sync_pb::AppSpecifics& app_specifics); |
| 77 | 79 |
| 78 DictionaryValue* AutofillSpecificsToValue( | 80 base::DictionaryValue* AutofillSpecificsToValue( |
| 79 const sync_pb::AutofillSpecifics& autofill_specifics); | 81 const sync_pb::AutofillSpecifics& autofill_specifics); |
| 80 | 82 |
| 81 DictionaryValue* AutofillCreditCardSpecificsToValue( | 83 base::DictionaryValue* AutofillCreditCardSpecificsToValue( |
| 82 const sync_pb::AutofillCreditCardSpecifics& | 84 const sync_pb::AutofillCreditCardSpecifics& |
| 83 autofill_credit_card_specifics); | 85 autofill_credit_card_specifics); |
| 84 | 86 |
| 85 DictionaryValue* AutofillProfileSpecificsToValue( | 87 base::DictionaryValue* AutofillProfileSpecificsToValue( |
| 86 const sync_pb::AutofillProfileSpecifics& autofill_profile_specifics); | 88 const sync_pb::AutofillProfileSpecifics& autofill_profile_specifics); |
| 87 | 89 |
| 88 DictionaryValue* BookmarkSpecificsToValue( | 90 base::DictionaryValue* BookmarkSpecificsToValue( |
| 89 const sync_pb::BookmarkSpecifics& bookmark_specifics); | 91 const sync_pb::BookmarkSpecifics& bookmark_specifics); |
| 90 | 92 |
| 91 DictionaryValue* ExtensionSpecificsToValue( | 93 base::DictionaryValue* ExtensionSpecificsToValue( |
| 92 const sync_pb::ExtensionSpecifics& extension_specifics); | 94 const sync_pb::ExtensionSpecifics& extension_specifics); |
| 93 | 95 |
| 94 DictionaryValue* NigoriSpecificsToValue( | 96 base::DictionaryValue* NigoriSpecificsToValue( |
| 95 const sync_pb::NigoriSpecifics& nigori_specifics); | 97 const sync_pb::NigoriSpecifics& nigori_specifics); |
| 96 | 98 |
| 97 DictionaryValue* PasswordSpecificsToValue( | 99 base::DictionaryValue* PasswordSpecificsToValue( |
| 98 const sync_pb::PasswordSpecifics& password_specifics); | 100 const sync_pb::PasswordSpecifics& password_specifics); |
| 99 | 101 |
| 100 DictionaryValue* PreferenceSpecificsToValue( | 102 base::DictionaryValue* PreferenceSpecificsToValue( |
| 101 const sync_pb::PreferenceSpecifics& password_specifics); | 103 const sync_pb::PreferenceSpecifics& password_specifics); |
| 102 | 104 |
| 103 DictionaryValue* SearchEngineSpecificsToValue( | 105 base::DictionaryValue* SearchEngineSpecificsToValue( |
| 104 const sync_pb::SearchEngineSpecifics& search_engine_specifics); | 106 const sync_pb::SearchEngineSpecifics& search_engine_specifics); |
| 105 | 107 |
| 106 DictionaryValue* SessionSpecificsToValue( | 108 base::DictionaryValue* SessionSpecificsToValue( |
| 107 const sync_pb::SessionSpecifics& session_specifics); | 109 const sync_pb::SessionSpecifics& session_specifics); |
| 108 | 110 |
| 109 DictionaryValue* ThemeSpecificsToValue( | 111 base::DictionaryValue* ThemeSpecificsToValue( |
| 110 const sync_pb::ThemeSpecifics& theme_specifics); | 112 const sync_pb::ThemeSpecifics& theme_specifics); |
| 111 | 113 |
| 112 DictionaryValue* TypedUrlSpecificsToValue( | 114 base::DictionaryValue* TypedUrlSpecificsToValue( |
| 113 const sync_pb::TypedUrlSpecifics& typed_url_specifics); | 115 const sync_pb::TypedUrlSpecifics& typed_url_specifics); |
| 114 | 116 |
| 115 // Any present extensions are mapped to sub-dictionary values with the | 117 // Any present extensions are mapped to sub-dictionary values with the |
| 116 // key equal to the extension name. | 118 // key equal to the extension name. |
| 117 DictionaryValue* EntitySpecificsToValue( | 119 base::DictionaryValue* EntitySpecificsToValue( |
| 118 const sync_pb::EntitySpecifics& entity_specifics); | 120 const sync_pb::EntitySpecifics& entity_specifics); |
| 119 | 121 |
| 120 } // namespace browser_sync | 122 } // namespace browser_sync |
| 121 | 123 |
| 122 #endif // CHROME_BROWSER_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ | 124 #endif // CHROME_BROWSER_SYNC_PROTOCOL_PROTO_VALUE_CONVERSIONS_H_ |
| OLD | NEW |