Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(196)

Side by Side Diff: sync/protocol/proto_value_conversions.cc

Issue 2092893002: arc: Create sync protos for Arc package. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits addressed. Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stdint.h> 9 #include <stdint.h>
10 10
11 #include <algorithm> 11 #include <algorithm>
12 #include <string> 12 #include <string>
13 13
14 #include "base/base64.h" 14 #include "base/base64.h"
15 #include "base/i18n/time_formatting.h" 15 #include "base/i18n/time_formatting.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "base/memory/ptr_util.h" 17 #include "base/memory/ptr_util.h"
18 #include "base/strings/string_number_conversions.h" 18 #include "base/strings/string_number_conversions.h"
19 #include "base/time/time.h" 19 #include "base/time/time.h"
20 #include "base/values.h" 20 #include "base/values.h"
21 #include "sync/internal_api/public/base/unique_position.h" 21 #include "sync/internal_api/public/base/unique_position.h"
22 #include "sync/protocol/app_list_specifics.pb.h" 22 #include "sync/protocol/app_list_specifics.pb.h"
23 #include "sync/protocol/app_notification_specifics.pb.h" 23 #include "sync/protocol/app_notification_specifics.pb.h"
24 #include "sync/protocol/app_setting_specifics.pb.h" 24 #include "sync/protocol/app_setting_specifics.pb.h"
25 #include "sync/protocol/app_specifics.pb.h" 25 #include "sync/protocol/app_specifics.pb.h"
26 #include "sync/protocol/arc_package_specifics.pb.h"
26 #include "sync/protocol/autofill_specifics.pb.h" 27 #include "sync/protocol/autofill_specifics.pb.h"
27 #include "sync/protocol/bookmark_specifics.pb.h" 28 #include "sync/protocol/bookmark_specifics.pb.h"
28 #include "sync/protocol/dictionary_specifics.pb.h" 29 #include "sync/protocol/dictionary_specifics.pb.h"
29 #include "sync/protocol/encryption.pb.h" 30 #include "sync/protocol/encryption.pb.h"
30 #include "sync/protocol/experiments_specifics.pb.h" 31 #include "sync/protocol/experiments_specifics.pb.h"
31 #include "sync/protocol/extension_setting_specifics.pb.h" 32 #include "sync/protocol/extension_setting_specifics.pb.h"
32 #include "sync/protocol/extension_specifics.pb.h" 33 #include "sync/protocol/extension_specifics.pb.h"
33 #include "sync/protocol/favicon_image_specifics.pb.h" 34 #include "sync/protocol/favicon_image_specifics.pb.h"
34 #include "sync/protocol/favicon_tracking_specifics.pb.h" 35 #include "sync/protocol/favicon_tracking_specifics.pb.h"
35 #include "sync/protocol/history_delete_directive_specifics.pb.h" 36 #include "sync/protocol/history_delete_directive_specifics.pb.h"
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 SET_STR(item_id); 266 SET_STR(item_id);
266 SET_ENUM(item_type, GetAppListItemTypeString); 267 SET_ENUM(item_type, GetAppListItemTypeString);
267 SET_STR(item_name); 268 SET_STR(item_name);
268 SET_STR(parent_id); 269 SET_STR(parent_id);
269 SET_STR(item_ordinal); 270 SET_STR(item_ordinal);
270 SET_STR(item_pin_ordinal); 271 SET_STR(item_pin_ordinal);
271 272
272 return value; 273 return value;
273 } 274 }
274 275
276 std::unique_ptr<base::DictionaryValue> ArcPackageSpecificsToValue(
277 const sync_pb::ArcPackageSpecifics& proto) {
278 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
279 SET_STR(package_name);
280 SET_INT32(package_version);
281 SET_INT64(last_backup_android_id);
282 SET_INT64(last_backup_time);
283
284 return value;
285 }
286
275 std::unique_ptr<base::DictionaryValue> AppNotificationToValue( 287 std::unique_ptr<base::DictionaryValue> AppNotificationToValue(
276 const sync_pb::AppNotification& proto) { 288 const sync_pb::AppNotification& proto) {
277 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); 289 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
278 SET_STR(guid); 290 SET_STR(guid);
279 SET_STR(app_id); 291 SET_STR(app_id);
280 SET_INT64(creation_timestamp_ms); 292 SET_INT64(creation_timestamp_ms);
281 SET_STR(title); 293 SET_STR(title);
282 SET_STR(body_text); 294 SET_STR(body_text);
283 SET_STR(link_url); 295 SET_STR(link_url);
284 SET_STR(link_text); 296 SET_STR(link_text);
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 SET_BOOL(encrypt_typed_urls); 573 SET_BOOL(encrypt_typed_urls);
562 SET_BOOL(encrypt_extension_settings); 574 SET_BOOL(encrypt_extension_settings);
563 SET_BOOL(encrypt_extensions); 575 SET_BOOL(encrypt_extensions);
564 SET_BOOL(encrypt_sessions); 576 SET_BOOL(encrypt_sessions);
565 SET_BOOL(encrypt_app_settings); 577 SET_BOOL(encrypt_app_settings);
566 SET_BOOL(encrypt_apps); 578 SET_BOOL(encrypt_apps);
567 SET_BOOL(encrypt_search_engines); 579 SET_BOOL(encrypt_search_engines);
568 SET_BOOL(encrypt_dictionary); 580 SET_BOOL(encrypt_dictionary);
569 SET_BOOL(encrypt_articles); 581 SET_BOOL(encrypt_articles);
570 SET_BOOL(encrypt_app_list); 582 SET_BOOL(encrypt_app_list);
583 SET_BOOL(encrypt_arc_package);
571 SET_BOOL(encrypt_everything); 584 SET_BOOL(encrypt_everything);
572 SET_BOOL(server_only_was_missing_keystore_migration_time); 585 SET_BOOL(server_only_was_missing_keystore_migration_time);
573 SET_BOOL(sync_tab_favicons); 586 SET_BOOL(sync_tab_favicons);
574 SET_ENUM(passphrase_type, PassphraseTypeString); 587 SET_ENUM(passphrase_type, PassphraseTypeString);
575 SET(keystore_decryptor_token, EncryptedDataToValue); 588 SET(keystore_decryptor_token, EncryptedDataToValue);
576 SET_INT64(keystore_migration_time); 589 SET_INT64(keystore_migration_time);
577 SET_INT64(custom_passphrase_time); 590 SET_INT64(custom_passphrase_time);
578 return value; 591 return value;
579 } 592 }
580 593
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 return value; 743 return value;
731 } 744 }
732 745
733 std::unique_ptr<base::DictionaryValue> EntitySpecificsToValue( 746 std::unique_ptr<base::DictionaryValue> EntitySpecificsToValue(
734 const sync_pb::EntitySpecifics& specifics) { 747 const sync_pb::EntitySpecifics& specifics) {
735 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue()); 748 std::unique_ptr<base::DictionaryValue> value(new base::DictionaryValue());
736 SET_FIELD(app, AppSpecificsToValue); 749 SET_FIELD(app, AppSpecificsToValue);
737 SET_FIELD(app_list, AppListSpecificsToValue); 750 SET_FIELD(app_list, AppListSpecificsToValue);
738 SET_FIELD(app_notification, AppNotificationToValue); 751 SET_FIELD(app_notification, AppNotificationToValue);
739 SET_FIELD(app_setting, AppSettingSpecificsToValue); 752 SET_FIELD(app_setting, AppSettingSpecificsToValue);
753 SET_FIELD(arc_package, ArcPackageSpecificsToValue);
740 SET_FIELD(article, ArticleSpecificsToValue); 754 SET_FIELD(article, ArticleSpecificsToValue);
741 SET_FIELD(autofill, AutofillSpecificsToValue); 755 SET_FIELD(autofill, AutofillSpecificsToValue);
742 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue); 756 SET_FIELD(autofill_profile, AutofillProfileSpecificsToValue);
743 SET_FIELD(autofill_wallet, AutofillWalletSpecificsToValue); 757 SET_FIELD(autofill_wallet, AutofillWalletSpecificsToValue);
744 SET_FIELD(wallet_metadata, WalletMetadataSpecificsToValue); 758 SET_FIELD(wallet_metadata, WalletMetadataSpecificsToValue);
745 SET_FIELD(bookmark, BookmarkSpecificsToValue); 759 SET_FIELD(bookmark, BookmarkSpecificsToValue);
746 SET_FIELD(device_info, DeviceInfoSpecificsToValue); 760 SET_FIELD(device_info, DeviceInfoSpecificsToValue);
747 SET_FIELD(dictionary, DictionarySpecificsToValue); 761 SET_FIELD(dictionary, DictionarySpecificsToValue);
748 SET_FIELD(experiments, ExperimentsSpecificsToValue); 762 SET_FIELD(experiments, ExperimentsSpecificsToValue);
749 SET_FIELD(extension, ExtensionSpecificsToValue); 763 SET_FIELD(extension, ExtensionSpecificsToValue);
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
1080 #undef SET_BYTES 1094 #undef SET_BYTES
1081 #undef SET_INT32 1095 #undef SET_INT32
1082 #undef SET_INT64 1096 #undef SET_INT64
1083 #undef SET_INT64_REP 1097 #undef SET_INT64_REP
1084 #undef SET_STR 1098 #undef SET_STR
1085 #undef SET_STR_REP 1099 #undef SET_STR_REP
1086 1100
1087 #undef SET_FIELD 1101 #undef SET_FIELD
1088 1102
1089 } // namespace syncer 1103 } // namespace syncer
OLDNEW
« no previous file with comments | « sync/protocol/proto_value_conversions.h ('k') | sync/protocol/proto_value_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698