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 #include "sync/internal_api/public/base/model_type.h" | 5 #include "sync/internal_api/public/base/model_type.h" |
6 | 6 |
7 #include "base/strings/string_split.h" | 7 #include "base/strings/string_split.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "sync/protocol/app_notification_specifics.pb.h" | 9 #include "sync/protocol/app_notification_specifics.pb.h" |
10 #include "sync/protocol/app_setting_specifics.pb.h" | 10 #include "sync/protocol/app_setting_specifics.pb.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 "autofill", | 37 "autofill", |
38 "themes", | 38 "themes", |
39 "typedUrls", | 39 "typedUrls", |
40 "extensions", | 40 "extensions", |
41 "apps", | 41 "apps", |
42 "wifiCredentials", | 42 "wifiCredentials", |
43 "tabs", | 43 "tabs", |
44 }; | 44 }; |
45 | 45 |
46 COMPILE_ASSERT( | 46 COMPILE_ASSERT( |
47 33 == MODEL_TYPE_COUNT, | 47 34 == MODEL_TYPE_COUNT, |
48 update_kUserSelectableDataTypeNames_to_match_UserSelectableTypes); | 48 update_kUserSelectableDataTypeNames_to_match_UserSelectableTypes); |
49 | 49 |
50 void AddDefaultFieldValue(ModelType datatype, | 50 void AddDefaultFieldValue(ModelType datatype, |
51 sync_pb::EntitySpecifics* specifics) { | 51 sync_pb::EntitySpecifics* specifics) { |
52 if (!ProtocolTypes().Has(datatype)) { | 52 if (!ProtocolTypes().Has(datatype)) { |
53 NOTREACHED() << "Only protocol types have field values."; | 53 NOTREACHED() << "Only protocol types have field values."; |
54 return; | 54 return; |
55 } | 55 } |
56 switch (datatype) { | 56 switch (datatype) { |
57 case BOOKMARKS: | 57 case BOOKMARKS: |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 break; | 131 break; |
132 case SUPERVISED_USER_SETTINGS: | 132 case SUPERVISED_USER_SETTINGS: |
133 specifics->mutable_managed_user_setting(); | 133 specifics->mutable_managed_user_setting(); |
134 break; | 134 break; |
135 case SUPERVISED_USERS: | 135 case SUPERVISED_USERS: |
136 specifics->mutable_managed_user(); | 136 specifics->mutable_managed_user(); |
137 break; | 137 break; |
138 case SUPERVISED_USER_SHARED_SETTINGS: | 138 case SUPERVISED_USER_SHARED_SETTINGS: |
139 specifics->mutable_managed_user_shared_setting(); | 139 specifics->mutable_managed_user_shared_setting(); |
140 break; | 140 break; |
| 141 case SUPERVISED_USER_WHITELISTS: |
| 142 specifics->mutable_managed_user_whitelist(); |
| 143 break; |
141 case ARTICLES: | 144 case ARTICLES: |
142 specifics->mutable_article(); | 145 specifics->mutable_article(); |
143 break; | 146 break; |
144 case WIFI_CREDENTIALS: | 147 case WIFI_CREDENTIALS: |
145 specifics->mutable_wifi_credential(); | 148 specifics->mutable_wifi_credential(); |
146 break; | 149 break; |
147 default: | 150 default: |
148 NOTREACHED() << "No known extension for model type."; | 151 NOTREACHED() << "No known extension for model type."; |
149 } | 152 } |
150 } | 153 } |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 case FAVICON_IMAGES: | 215 case FAVICON_IMAGES: |
213 return sync_pb::EntitySpecifics::kFaviconImageFieldNumber; | 216 return sync_pb::EntitySpecifics::kFaviconImageFieldNumber; |
214 case FAVICON_TRACKING: | 217 case FAVICON_TRACKING: |
215 return sync_pb::EntitySpecifics::kFaviconTrackingFieldNumber; | 218 return sync_pb::EntitySpecifics::kFaviconTrackingFieldNumber; |
216 case SUPERVISED_USER_SETTINGS: | 219 case SUPERVISED_USER_SETTINGS: |
217 return sync_pb::EntitySpecifics::kManagedUserSettingFieldNumber; | 220 return sync_pb::EntitySpecifics::kManagedUserSettingFieldNumber; |
218 case SUPERVISED_USERS: | 221 case SUPERVISED_USERS: |
219 return sync_pb::EntitySpecifics::kManagedUserFieldNumber; | 222 return sync_pb::EntitySpecifics::kManagedUserFieldNumber; |
220 case SUPERVISED_USER_SHARED_SETTINGS: | 223 case SUPERVISED_USER_SHARED_SETTINGS: |
221 return sync_pb::EntitySpecifics::kManagedUserSharedSettingFieldNumber; | 224 return sync_pb::EntitySpecifics::kManagedUserSharedSettingFieldNumber; |
| 225 case SUPERVISED_USER_WHITELISTS: |
| 226 return sync_pb::EntitySpecifics::kManagedUserWhitelistFieldNumber; |
222 case ARTICLES: | 227 case ARTICLES: |
223 return sync_pb::EntitySpecifics::kArticleFieldNumber; | 228 return sync_pb::EntitySpecifics::kArticleFieldNumber; |
224 case WIFI_CREDENTIALS: | 229 case WIFI_CREDENTIALS: |
225 return sync_pb::EntitySpecifics::kWifiCredentialFieldNumber; | 230 return sync_pb::EntitySpecifics::kWifiCredentialFieldNumber; |
226 default: | 231 default: |
227 NOTREACHED() << "No known extension for model type."; | 232 NOTREACHED() << "No known extension for model type."; |
228 return 0; | 233 return 0; |
229 } | 234 } |
230 } | 235 } |
231 | 236 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 | 346 |
342 if (specifics.has_managed_user_setting()) | 347 if (specifics.has_managed_user_setting()) |
343 return SUPERVISED_USER_SETTINGS; | 348 return SUPERVISED_USER_SETTINGS; |
344 | 349 |
345 if (specifics.has_managed_user()) | 350 if (specifics.has_managed_user()) |
346 return SUPERVISED_USERS; | 351 return SUPERVISED_USERS; |
347 | 352 |
348 if (specifics.has_managed_user_shared_setting()) | 353 if (specifics.has_managed_user_shared_setting()) |
349 return SUPERVISED_USER_SHARED_SETTINGS; | 354 return SUPERVISED_USER_SHARED_SETTINGS; |
350 | 355 |
| 356 if (specifics.has_managed_user_whitelist()) |
| 357 return SUPERVISED_USER_WHITELISTS; |
| 358 |
351 if (specifics.has_article()) | 359 if (specifics.has_article()) |
352 return ARTICLES; | 360 return ARTICLES; |
353 | 361 |
354 if (specifics.has_wifi_credential()) | 362 if (specifics.has_wifi_credential()) |
355 return WIFI_CREDENTIALS; | 363 return WIFI_CREDENTIALS; |
356 | 364 |
357 return UNSPECIFIED; | 365 return UNSPECIFIED; |
358 } | 366 } |
359 | 367 |
360 ModelTypeSet ProtocolTypes() { | 368 ModelTypeSet ProtocolTypes() { |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 // Priority preferences are not encrypted because they might be synced before | 430 // Priority preferences are not encrypted because they might be synced before |
423 // encryption is ready. | 431 // encryption is ready. |
424 encryptable_user_types.Remove(PRIORITY_PREFERENCES); | 432 encryptable_user_types.Remove(PRIORITY_PREFERENCES); |
425 // Supervised user settings are not encrypted since they are set server-side. | 433 // Supervised user settings are not encrypted since they are set server-side. |
426 encryptable_user_types.Remove(SUPERVISED_USER_SETTINGS); | 434 encryptable_user_types.Remove(SUPERVISED_USER_SETTINGS); |
427 // Supervised users are not encrypted since they are managed server-side. | 435 // Supervised users are not encrypted since they are managed server-side. |
428 encryptable_user_types.Remove(SUPERVISED_USERS); | 436 encryptable_user_types.Remove(SUPERVISED_USERS); |
429 // Supervised user shared settings are not encrypted since they are managed | 437 // Supervised user shared settings are not encrypted since they are managed |
430 // server-side and shared between manager and supervised user. | 438 // server-side and shared between manager and supervised user. |
431 encryptable_user_types.Remove(SUPERVISED_USER_SHARED_SETTINGS); | 439 encryptable_user_types.Remove(SUPERVISED_USER_SHARED_SETTINGS); |
| 440 // Supervised user whitelists are not encrypted since they are managed |
| 441 // server-side. |
| 442 encryptable_user_types.Remove(SUPERVISED_USER_WHITELISTS); |
432 // Proxy types have no sync representation and are therefore not encrypted. | 443 // Proxy types have no sync representation and are therefore not encrypted. |
433 // Note however that proxy types map to one or more protocol types, which | 444 // Note however that proxy types map to one or more protocol types, which |
434 // may or may not be encrypted themselves. | 445 // may or may not be encrypted themselves. |
435 encryptable_user_types.RemoveAll(ProxyTypes()); | 446 encryptable_user_types.RemoveAll(ProxyTypes()); |
436 return encryptable_user_types; | 447 return encryptable_user_types; |
437 } | 448 } |
438 | 449 |
439 ModelTypeSet PriorityUserTypes() { | 450 ModelTypeSet PriorityUserTypes() { |
440 return ModelTypeSet(DEVICE_INFO, PRIORITY_PREFERENCES); | 451 return ModelTypeSet(DEVICE_INFO, PRIORITY_PREFERENCES); |
441 } | 452 } |
(...skipping 21 matching lines...) Expand all Loading... |
463 } | 474 } |
464 | 475 |
465 ModelTypeSet CoreTypes() { | 476 ModelTypeSet CoreTypes() { |
466 syncer::ModelTypeSet result; | 477 syncer::ModelTypeSet result; |
467 result.PutAll(PriorityCoreTypes()); | 478 result.PutAll(PriorityCoreTypes()); |
468 | 479 |
469 // The following are low priority core types. | 480 // The following are low priority core types. |
470 result.Put(SYNCED_NOTIFICATIONS); | 481 result.Put(SYNCED_NOTIFICATIONS); |
471 result.Put(SYNCED_NOTIFICATION_APP_INFO); | 482 result.Put(SYNCED_NOTIFICATION_APP_INFO); |
472 result.Put(SUPERVISED_USER_SHARED_SETTINGS); | 483 result.Put(SUPERVISED_USER_SHARED_SETTINGS); |
| 484 result.Put(SUPERVISED_USER_WHITELISTS); |
473 | 485 |
474 return result; | 486 return result; |
475 } | 487 } |
476 | 488 |
477 ModelTypeSet PriorityCoreTypes() { | 489 ModelTypeSet PriorityCoreTypes() { |
478 syncer::ModelTypeSet result; | 490 syncer::ModelTypeSet result; |
479 result.PutAll(ControlTypes()); | 491 result.PutAll(ControlTypes()); |
480 | 492 |
481 // The following are non-control core types. | 493 // The following are non-control core types. |
482 result.Put(SUPERVISED_USERS); | 494 result.Put(SUPERVISED_USERS); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 case FAVICON_IMAGES: | 570 case FAVICON_IMAGES: |
559 return "Favicon Images"; | 571 return "Favicon Images"; |
560 case FAVICON_TRACKING: | 572 case FAVICON_TRACKING: |
561 return "Favicon Tracking"; | 573 return "Favicon Tracking"; |
562 case SUPERVISED_USER_SETTINGS: | 574 case SUPERVISED_USER_SETTINGS: |
563 return "Managed User Settings"; | 575 return "Managed User Settings"; |
564 case SUPERVISED_USERS: | 576 case SUPERVISED_USERS: |
565 return "Managed Users"; | 577 return "Managed Users"; |
566 case SUPERVISED_USER_SHARED_SETTINGS: | 578 case SUPERVISED_USER_SHARED_SETTINGS: |
567 return "Managed User Shared Settings"; | 579 return "Managed User Shared Settings"; |
| 580 case SUPERVISED_USER_WHITELISTS: |
| 581 return "Managed User Whitelists"; |
568 case ARTICLES: | 582 case ARTICLES: |
569 return "Articles"; | 583 return "Articles"; |
570 case WIFI_CREDENTIALS: | 584 case WIFI_CREDENTIALS: |
571 return "WiFi Credentials"; | 585 return "WiFi Credentials"; |
572 case PROXY_TABS: | 586 case PROXY_TABS: |
573 return "Tabs"; | 587 return "Tabs"; |
574 default: | 588 default: |
575 break; | 589 break; |
576 } | 590 } |
577 NOTREACHED() << "No known extension for model type."; | 591 NOTREACHED() << "No known extension for model type."; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 case ARTICLES: | 657 case ARTICLES: |
644 return 28; | 658 return 28; |
645 case APP_LIST: | 659 case APP_LIST: |
646 return 29; | 660 return 29; |
647 case SUPERVISED_USER_SHARED_SETTINGS: | 661 case SUPERVISED_USER_SHARED_SETTINGS: |
648 return 30; | 662 return 30; |
649 case SYNCED_NOTIFICATION_APP_INFO: | 663 case SYNCED_NOTIFICATION_APP_INFO: |
650 return 31; | 664 return 31; |
651 case WIFI_CREDENTIALS: | 665 case WIFI_CREDENTIALS: |
652 return 32; | 666 return 32; |
| 667 case SUPERVISED_USER_WHITELISTS: |
| 668 return 33; |
653 // Silence a compiler warning. | 669 // Silence a compiler warning. |
654 case MODEL_TYPE_COUNT: | 670 case MODEL_TYPE_COUNT: |
655 return 0; | 671 return 0; |
656 } | 672 } |
657 return 0; | 673 return 0; |
658 } | 674 } |
659 | 675 |
660 base::StringValue* ModelTypeToValue(ModelType model_type) { | 676 base::StringValue* ModelTypeToValue(ModelType model_type) { |
661 if (model_type >= FIRST_REAL_MODEL_TYPE) { | 677 if (model_type >= FIRST_REAL_MODEL_TYPE) { |
662 return new base::StringValue(ModelTypeToString(model_type)); | 678 return new base::StringValue(ModelTypeToString(model_type)); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
734 else if (model_type_string == "Favicon Images") | 750 else if (model_type_string == "Favicon Images") |
735 return FAVICON_IMAGES; | 751 return FAVICON_IMAGES; |
736 else if (model_type_string == "Favicon Tracking") | 752 else if (model_type_string == "Favicon Tracking") |
737 return FAVICON_TRACKING; | 753 return FAVICON_TRACKING; |
738 else if (model_type_string == "Managed User Settings") | 754 else if (model_type_string == "Managed User Settings") |
739 return SUPERVISED_USER_SETTINGS; | 755 return SUPERVISED_USER_SETTINGS; |
740 else if (model_type_string == "Managed Users") | 756 else if (model_type_string == "Managed Users") |
741 return SUPERVISED_USERS; | 757 return SUPERVISED_USERS; |
742 else if (model_type_string == "Managed User Shared Settings") | 758 else if (model_type_string == "Managed User Shared Settings") |
743 return SUPERVISED_USER_SHARED_SETTINGS; | 759 return SUPERVISED_USER_SHARED_SETTINGS; |
| 760 else if (model_type_string == "Managed User Whitelists") |
| 761 return SUPERVISED_USER_WHITELISTS; |
744 else if (model_type_string == "Articles") | 762 else if (model_type_string == "Articles") |
745 return ARTICLES; | 763 return ARTICLES; |
746 else if (model_type_string == "WiFi Credentials") | 764 else if (model_type_string == "WiFi Credentials") |
747 return WIFI_CREDENTIALS; | 765 return WIFI_CREDENTIALS; |
748 else if (model_type_string == "Tabs") | 766 else if (model_type_string == "Tabs") |
749 return PROXY_TABS; | 767 return PROXY_TABS; |
750 else | 768 else |
751 NOTREACHED() << "No known model type corresponding to " | 769 NOTREACHED() << "No known model type corresponding to " |
752 << model_type_string << "."; | 770 << model_type_string << "."; |
753 return UNSPECIFIED; | 771 return UNSPECIFIED; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 case FAVICON_IMAGES: | 878 case FAVICON_IMAGES: |
861 return "google_chrome_favicon_images"; | 879 return "google_chrome_favicon_images"; |
862 case FAVICON_TRACKING: | 880 case FAVICON_TRACKING: |
863 return "google_chrome_favicon_tracking"; | 881 return "google_chrome_favicon_tracking"; |
864 case SUPERVISED_USER_SETTINGS: | 882 case SUPERVISED_USER_SETTINGS: |
865 return "google_chrome_managed_user_settings"; | 883 return "google_chrome_managed_user_settings"; |
866 case SUPERVISED_USERS: | 884 case SUPERVISED_USERS: |
867 return "google_chrome_managed_users"; | 885 return "google_chrome_managed_users"; |
868 case SUPERVISED_USER_SHARED_SETTINGS: | 886 case SUPERVISED_USER_SHARED_SETTINGS: |
869 return "google_chrome_managed_user_shared_settings"; | 887 return "google_chrome_managed_user_shared_settings"; |
| 888 case SUPERVISED_USER_WHITELISTS: |
| 889 return "google_chrome_managed_user_whitelists"; |
870 case ARTICLES: | 890 case ARTICLES: |
871 return "google_chrome_articles"; | 891 return "google_chrome_articles"; |
872 case WIFI_CREDENTIALS: | 892 case WIFI_CREDENTIALS: |
873 return "google_chrome_wifi_credentials"; | 893 return "google_chrome_wifi_credentials"; |
874 case PROXY_TABS: | 894 case PROXY_TABS: |
875 return std::string(); | 895 return std::string(); |
876 default: | 896 default: |
877 break; | 897 break; |
878 } | 898 } |
879 NOTREACHED() << "No known extension for model type."; | 899 NOTREACHED() << "No known extension for model type."; |
(...skipping 27 matching lines...) Expand all Loading... |
907 const char kDeviceInfoNotificationType[] = "DEVICE_INFO"; | 927 const char kDeviceInfoNotificationType[] = "DEVICE_INFO"; |
908 const char kExperimentsNotificationType[] = "EXPERIMENTS"; | 928 const char kExperimentsNotificationType[] = "EXPERIMENTS"; |
909 const char kPriorityPreferenceNotificationType[] = "PRIORITY_PREFERENCE"; | 929 const char kPriorityPreferenceNotificationType[] = "PRIORITY_PREFERENCE"; |
910 const char kDictionaryNotificationType[] = "DICTIONARY"; | 930 const char kDictionaryNotificationType[] = "DICTIONARY"; |
911 const char kFaviconImageNotificationType[] = "FAVICON_IMAGE"; | 931 const char kFaviconImageNotificationType[] = "FAVICON_IMAGE"; |
912 const char kFaviconTrackingNotificationType[] = "FAVICON_TRACKING"; | 932 const char kFaviconTrackingNotificationType[] = "FAVICON_TRACKING"; |
913 const char kSupervisedUserSettingNotificationType[] = "MANAGED_USER_SETTING"; | 933 const char kSupervisedUserSettingNotificationType[] = "MANAGED_USER_SETTING"; |
914 const char kSupervisedUserNotificationType[] = "MANAGED_USER"; | 934 const char kSupervisedUserNotificationType[] = "MANAGED_USER"; |
915 const char kSupervisedUserSharedSettingNotificationType[] = | 935 const char kSupervisedUserSharedSettingNotificationType[] = |
916 "MANAGED_USER_SHARED_SETTING"; | 936 "MANAGED_USER_SHARED_SETTING"; |
| 937 const char kSupervisedUserWhitelistNotificationType[] = |
| 938 "MANAGED_USER_WHITELIST"; |
917 const char kArticleNotificationType[] = "ARTICLE"; | 939 const char kArticleNotificationType[] = "ARTICLE"; |
918 } // namespace | 940 } // namespace |
919 | 941 |
920 bool RealModelTypeToNotificationType(ModelType model_type, | 942 bool RealModelTypeToNotificationType(ModelType model_type, |
921 std::string* notification_type) { | 943 std::string* notification_type) { |
922 switch (model_type) { | 944 switch (model_type) { |
923 case BOOKMARKS: | 945 case BOOKMARKS: |
924 *notification_type = kBookmarkNotificationType; | 946 *notification_type = kBookmarkNotificationType; |
925 return true; | 947 return true; |
926 case PREFERENCES: | 948 case PREFERENCES: |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
997 return true; | 1019 return true; |
998 case SUPERVISED_USER_SETTINGS: | 1020 case SUPERVISED_USER_SETTINGS: |
999 *notification_type = kSupervisedUserSettingNotificationType; | 1021 *notification_type = kSupervisedUserSettingNotificationType; |
1000 return true; | 1022 return true; |
1001 case SUPERVISED_USERS: | 1023 case SUPERVISED_USERS: |
1002 *notification_type = kSupervisedUserNotificationType; | 1024 *notification_type = kSupervisedUserNotificationType; |
1003 return true; | 1025 return true; |
1004 case SUPERVISED_USER_SHARED_SETTINGS: | 1026 case SUPERVISED_USER_SHARED_SETTINGS: |
1005 *notification_type = kSupervisedUserSharedSettingNotificationType; | 1027 *notification_type = kSupervisedUserSharedSettingNotificationType; |
1006 return true; | 1028 return true; |
| 1029 case SUPERVISED_USER_WHITELISTS: |
| 1030 *notification_type = kSupervisedUserWhitelistNotificationType; |
| 1031 return true; |
1007 case ARTICLES: | 1032 case ARTICLES: |
1008 *notification_type = kArticleNotificationType; | 1033 *notification_type = kArticleNotificationType; |
1009 return true; | 1034 return true; |
1010 default: | 1035 default: |
1011 break; | 1036 break; |
1012 } | 1037 } |
1013 notification_type->clear(); | 1038 notification_type->clear(); |
1014 return false; | 1039 return false; |
1015 } | 1040 } |
1016 | 1041 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1094 } else if (notification_type == kSupervisedUserSettingNotificationType) { | 1119 } else if (notification_type == kSupervisedUserSettingNotificationType) { |
1095 *model_type = SUPERVISED_USER_SETTINGS; | 1120 *model_type = SUPERVISED_USER_SETTINGS; |
1096 return true; | 1121 return true; |
1097 } else if (notification_type == kSupervisedUserNotificationType) { | 1122 } else if (notification_type == kSupervisedUserNotificationType) { |
1098 *model_type = SUPERVISED_USERS; | 1123 *model_type = SUPERVISED_USERS; |
1099 return true; | 1124 return true; |
1100 } else if (notification_type == | 1125 } else if (notification_type == |
1101 kSupervisedUserSharedSettingNotificationType) { | 1126 kSupervisedUserSharedSettingNotificationType) { |
1102 *model_type = SUPERVISED_USER_SHARED_SETTINGS; | 1127 *model_type = SUPERVISED_USER_SHARED_SETTINGS; |
1103 return true; | 1128 return true; |
| 1129 } else if (notification_type == kSupervisedUserWhitelistNotificationType) { |
| 1130 *model_type = SUPERVISED_USER_WHITELISTS; |
| 1131 return true; |
1104 } else if (notification_type == kArticleNotificationType) { | 1132 } else if (notification_type == kArticleNotificationType) { |
1105 *model_type = ARTICLES; | 1133 *model_type = ARTICLES; |
1106 return true; | 1134 return true; |
1107 } | 1135 } |
1108 *model_type = UNSPECIFIED; | 1136 *model_type = UNSPECIFIED; |
1109 return false; | 1137 return false; |
1110 } | 1138 } |
1111 | 1139 |
1112 bool IsRealDataType(ModelType model_type) { | 1140 bool IsRealDataType(ModelType model_type) { |
1113 return model_type >= FIRST_REAL_MODEL_TYPE && model_type < MODEL_TYPE_COUNT; | 1141 return model_type >= FIRST_REAL_MODEL_TYPE && model_type < MODEL_TYPE_COUNT; |
1114 } | 1142 } |
1115 | 1143 |
1116 bool IsProxyType(ModelType model_type) { | 1144 bool IsProxyType(ModelType model_type) { |
1117 return model_type >= FIRST_PROXY_TYPE && model_type <= LAST_PROXY_TYPE; | 1145 return model_type >= FIRST_PROXY_TYPE && model_type <= LAST_PROXY_TYPE; |
1118 } | 1146 } |
1119 | 1147 |
1120 bool IsActOnceDataType(ModelType model_type) { | 1148 bool IsActOnceDataType(ModelType model_type) { |
1121 return model_type == HISTORY_DELETE_DIRECTIVES; | 1149 return model_type == HISTORY_DELETE_DIRECTIVES; |
1122 } | 1150 } |
1123 | 1151 |
1124 } // namespace syncer | 1152 } // namespace syncer |
OLD | NEW |