| 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 #include "sync/protocol/proto_value_conversions.h" | 7 #include "sync/protocol/proto_value_conversions.h" |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "sync/protocol/app_notification_specifics.pb.h" | 14 #include "sync/protocol/app_notification_specifics.pb.h" |
| 15 #include "sync/protocol/app_setting_specifics.pb.h" | 15 #include "sync/protocol/app_setting_specifics.pb.h" |
| 16 #include "sync/protocol/app_specifics.pb.h" | 16 #include "sync/protocol/app_specifics.pb.h" |
| 17 #include "sync/protocol/autofill_specifics.pb.h" | 17 #include "sync/protocol/autofill_specifics.pb.h" |
| 18 #include "sync/protocol/bookmark_specifics.pb.h" | 18 #include "sync/protocol/bookmark_specifics.pb.h" |
| 19 #include "sync/protocol/encryption.pb.h" | 19 #include "sync/protocol/encryption.pb.h" |
| 20 #include "sync/protocol/extension_setting_specifics.pb.h" | 20 #include "sync/protocol/extension_setting_specifics.pb.h" |
| 21 #include "sync/protocol/extension_specifics.pb.h" | 21 #include "sync/protocol/extension_specifics.pb.h" |
| 22 #include "sync/protocol/history_delete_directive_specifics.pb.h" |
| 22 #include "sync/protocol/nigori_specifics.pb.h" | 23 #include "sync/protocol/nigori_specifics.pb.h" |
| 23 #include "sync/protocol/password_specifics.pb.h" | 24 #include "sync/protocol/password_specifics.pb.h" |
| 24 #include "sync/protocol/preference_specifics.pb.h" | 25 #include "sync/protocol/preference_specifics.pb.h" |
| 25 #include "sync/protocol/proto_enum_conversions.h" | 26 #include "sync/protocol/proto_enum_conversions.h" |
| 26 #include "sync/protocol/search_engine_specifics.pb.h" | 27 #include "sync/protocol/search_engine_specifics.pb.h" |
| 27 #include "sync/protocol/session_specifics.pb.h" | 28 #include "sync/protocol/session_specifics.pb.h" |
| 28 #include "sync/protocol/sync.pb.h" | 29 #include "sync/protocol/sync.pb.h" |
| 29 #include "sync/protocol/theme_specifics.pb.h" | 30 #include "sync/protocol/theme_specifics.pb.h" |
| 30 #include "sync/protocol/typed_url_specifics.pb.h" | 31 #include "sync/protocol/typed_url_specifics.pb.h" |
| 31 | 32 |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 DictionaryValue* value = new DictionaryValue(); | 284 DictionaryValue* value = new DictionaryValue(); |
| 284 SET_STR(id); | 285 SET_STR(id); |
| 285 SET_STR(version); | 286 SET_STR(version); |
| 286 SET_STR(update_url); | 287 SET_STR(update_url); |
| 287 SET_BOOL(enabled); | 288 SET_BOOL(enabled); |
| 288 SET_BOOL(incognito_enabled); | 289 SET_BOOL(incognito_enabled); |
| 289 SET_STR(name); | 290 SET_STR(name); |
| 290 return value; | 291 return value; |
| 291 } | 292 } |
| 292 | 293 |
| 294 base::DictionaryValue* HistoryDeleteDirectiveSpecificsToValue( |
| 295 const sync_pb::HistoryDeleteDirectiveSpecifics& proto) { |
| 296 DictionaryValue* value = new DictionaryValue(); |
| 297 SET_STR(url); |
| 298 SET_STR(client_id); |
| 299 SET_INT64(creation_time); |
| 300 SET_INT64(start_time); |
| 301 SET_INT64(end_time); |
| 302 return value; |
| 303 } |
| 304 |
| 293 DictionaryValue* NigoriSpecificsToValue( | 305 DictionaryValue* NigoriSpecificsToValue( |
| 294 const sync_pb::NigoriSpecifics& proto) { | 306 const sync_pb::NigoriSpecifics& proto) { |
| 295 DictionaryValue* value = new DictionaryValue(); | 307 DictionaryValue* value = new DictionaryValue(); |
| 296 SET(encrypted, EncryptedDataToValue); | 308 SET(encrypted, EncryptedDataToValue); |
| 297 SET_BOOL(using_explicit_passphrase); | 309 SET_BOOL(using_explicit_passphrase); |
| 298 SET_BOOL(encrypt_bookmarks); | 310 SET_BOOL(encrypt_bookmarks); |
| 299 SET_BOOL(encrypt_preferences); | 311 SET_BOOL(encrypt_preferences); |
| 300 SET_BOOL(encrypt_autofill_profile); | 312 SET_BOOL(encrypt_autofill_profile); |
| 301 SET_BOOL(encrypt_autofill); | 313 SET_BOOL(encrypt_autofill); |
| 302 SET_BOOL(encrypt_themes); | 314 SET_BOOL(encrypt_themes); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 385 const sync_pb::EntitySpecifics& specifics) { | 397 const sync_pb::EntitySpecifics& specifics) { |
| 386 DictionaryValue* value = new DictionaryValue(); | 398 DictionaryValue* value = new DictionaryValue(); |
| 387 SET_FIELD(app, AppSpecificsToValue); | 399 SET_FIELD(app, AppSpecificsToValue); |
| 388 SET_FIELD(app_notification, AppNotificationToValue); | 400 SET_FIELD(app_notification, AppNotificationToValue); |
| 389 SET_FIELD(app_setting, AppSettingSpecificsToValue); | 401 SET_FIELD(app_setting, AppSettingSpecificsToValue); |
| 390 SET_FIELD(autofill, AutofillSpecificsToValue); | 402 SET_FIELD(autofill, AutofillSpecificsToValue); |
| 391 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); | 403 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); |
| 392 SET_FIELD(bookmark, BookmarkSpecificsToValue); | 404 SET_FIELD(bookmark, BookmarkSpecificsToValue); |
| 393 SET_FIELD(extension, ExtensionSpecificsToValue); | 405 SET_FIELD(extension, ExtensionSpecificsToValue); |
| 394 SET_FIELD(extension_setting, ExtensionSettingSpecificsToValue); | 406 SET_FIELD(extension_setting, ExtensionSettingSpecificsToValue); |
| 407 SET_FIELD(history_delete_directive, HistoryDeleteDirectiveSpecificsToValue); |
| 395 SET_FIELD(nigori, NigoriSpecificsToValue); | 408 SET_FIELD(nigori, NigoriSpecificsToValue); |
| 396 SET_FIELD(password, PasswordSpecificsToValue); | 409 SET_FIELD(password, PasswordSpecificsToValue); |
| 397 SET_FIELD(preference, PreferenceSpecificsToValue); | 410 SET_FIELD(preference, PreferenceSpecificsToValue); |
| 398 SET_FIELD(search_engine, SearchEngineSpecificsToValue); | 411 SET_FIELD(search_engine, SearchEngineSpecificsToValue); |
| 399 SET_FIELD(session, SessionSpecificsToValue); | 412 SET_FIELD(session, SessionSpecificsToValue); |
| 400 SET_FIELD(theme, ThemeSpecificsToValue); | 413 SET_FIELD(theme, ThemeSpecificsToValue); |
| 401 SET_FIELD(typed_url, TypedUrlSpecificsToValue); | 414 SET_FIELD(typed_url, TypedUrlSpecificsToValue); |
| 402 return value; | 415 return value; |
| 403 } | 416 } |
| 404 | 417 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 587 #undef SET_BYTES | 600 #undef SET_BYTES |
| 588 #undef SET_INT32 | 601 #undef SET_INT32 |
| 589 #undef SET_INT64 | 602 #undef SET_INT64 |
| 590 #undef SET_INT64_REP | 603 #undef SET_INT64_REP |
| 591 #undef SET_STR | 604 #undef SET_STR |
| 592 #undef SET_STR_REP | 605 #undef SET_STR_REP |
| 593 | 606 |
| 594 #undef SET_FIELD | 607 #undef SET_FIELD |
| 595 | 608 |
| 596 } // namespace syncer | 609 } // namespace syncer |
| OLD | NEW |