proto_enum_conversions.h 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  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
  3. // found in the LICENSE file.
  4. #ifndef COMPONENTS_SYNC_PROTOCOL_PROTO_ENUM_CONVERSIONS_H_
  5. #define COMPONENTS_SYNC_PROTOCOL_PROTO_ENUM_CONVERSIONS_H_
  6. #include "components/sync/protocol/app_list_specifics.pb.h"
  7. #include "components/sync/protocol/app_specifics.pb.h"
  8. #include "components/sync/protocol/autofill_specifics.pb.h"
  9. #include "components/sync/protocol/contact_info_specifics.pb.h"
  10. #include "components/sync/protocol/gaia_password_reuse.pb.h"
  11. #include "components/sync/protocol/get_updates_caller_info.pb.h"
  12. #include "components/sync/protocol/nigori_specifics.pb.h"
  13. #include "components/sync/protocol/reading_list_specifics.pb.h"
  14. #include "components/sync/protocol/saved_tab_group_specifics.pb.h"
  15. #include "components/sync/protocol/session_specifics.pb.h"
  16. #include "components/sync/protocol/sync.pb.h"
  17. #include "components/sync/protocol/sync_enums.pb.h"
  18. #include "components/sync/protocol/user_consent_types.pb.h"
  19. #include "components/sync/protocol/user_event_specifics.pb.h"
  20. #include "components/sync/protocol/web_app_specifics.pb.h"
  21. #include "components/sync/protocol/wifi_configuration_specifics.pb.h"
  22. #include "components/sync/protocol/workspace_desk_specifics.pb.h"
  23. // Keep this file in sync with the .proto files in this directory.
  24. //
  25. // Utility functions to get the string equivalent for some sync proto
  26. // enums.
  27. namespace syncer {
  28. // The returned strings (which don't have to be freed) are in ASCII.
  29. // The result of passing in an invalid enum value is undefined.
  30. const char* ProtoEnumToString(
  31. sync_pb::AppListSpecifics::AppListItemType item_type);
  32. const char* ProtoEnumToString(sync_pb::AppSpecifics::LaunchType launch_type);
  33. const char* ProtoEnumToString(
  34. sync_pb::AutofillWalletSpecifics::WalletInfoType wallet_info_type);
  35. const char* ProtoEnumToString(sync_pb::BookmarkSpecifics::Type type);
  36. const char* ProtoEnumToString(
  37. sync_pb::CommitResponse::ResponseType response_type);
  38. const char* ProtoEnumToString(
  39. sync_pb::ContactInfoSpecifics::VerificationStatus verification_status);
  40. const char* ProtoEnumToString(
  41. sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source);
  42. const char* ProtoEnumToString(sync_pb::NigoriSpecifics::PassphraseType type);
  43. const char* ProtoEnumToString(
  44. sync_pb::ReadingListSpecifics::ReadingListEntryStatus status);
  45. const char* ProtoEnumToString(sync_pb::SavedTabGroup::SavedTabGroupColor color);
  46. const char* ProtoEnumToString(
  47. sync_pb::SearchEngineSpecifics::ActiveStatus is_active);
  48. const char* ProtoEnumToString(sync_pb::SessionTab::FaviconType favicon_type);
  49. const char* ProtoEnumToString(sync_pb::SyncEnums::BrowserType browser_type);
  50. const char* ProtoEnumToString(sync_pb::SyncEnums::Action action);
  51. const char* ProtoEnumToString(sync_pb::SyncEnums::DeviceType device_type);
  52. const char* ProtoEnumToString(sync_pb::SyncEnums::ErrorType error_type);
  53. const char* ProtoEnumToString(sync_pb::SyncEnums::GetUpdatesOrigin origin);
  54. const char* ProtoEnumToString(
  55. sync_pb::SyncEnums::PageTransition page_transition);
  56. const char* ProtoEnumToString(
  57. sync_pb::SyncEnums::PageTransitionRedirectType redirect_type);
  58. const char* ProtoEnumToString(sync_pb::SyncEnums::SingletonDebugEventType type);
  59. const char* ProtoEnumToString(sync_pb::TabNavigation::BlockedState state);
  60. const char* ProtoEnumToString(sync_pb::SyncEnums::PasswordState state);
  61. const char* ProtoEnumToString(sync_pb::UserConsentTypes::ConsentStatus status);
  62. const char* ProtoEnumToString(
  63. sync_pb::GaiaPasswordReuse::PasswordReuseDetected::SafeBrowsingStatus::
  64. ReportingPopulation safe_browsing_reporting_population);
  65. const char* ProtoEnumToString(
  66. sync_pb::GaiaPasswordReuse::PasswordReuseDialogInteraction::
  67. InteractionResult interaction_result);
  68. const char* ProtoEnumToString(
  69. sync_pb::GaiaPasswordReuse::PasswordReuseLookup::LookupResult
  70. lookup_result);
  71. const char* ProtoEnumToString(
  72. sync_pb::GaiaPasswordReuse::PasswordReuseLookup::ReputationVerdict verdict);
  73. // TODO(markusheintz): Remove.
  74. const char* ProtoEnumToString(
  75. sync_pb::GaiaPasswordReuse::PasswordCaptured::EventTrigger trigger);
  76. const char* ProtoEnumToString(
  77. sync_pb::UserEventSpecifics::GaiaPasswordCaptured::EventTrigger trigger);
  78. const char* ProtoEnumToString(
  79. sync_pb::UserEventSpecifics::FlocIdComputed::EventTrigger trigger);
  80. const char* ProtoEnumToString(
  81. sync_pb::WalletMaskedCreditCard::VirtualCardEnrollmentState
  82. virtual_card_enrollment_state);
  83. const char* ProtoEnumToString(
  84. sync_pb::WalletMaskedCreditCard::WalletCardStatus wallet_card_status);
  85. const char* ProtoEnumToString(
  86. sync_pb::WalletMaskedCreditCard::WalletCardType wallet_card_type);
  87. const char* ProtoEnumToString(sync_pb::CardIssuer::Issuer issuer);
  88. const char* ProtoEnumToString(
  89. sync_pb::WalletMetadataSpecifics::Type wallet_metadata_type);
  90. const char* ProtoEnumToString(sync_pb::WebAppIconInfo::Purpose purpose);
  91. const char* ProtoEnumToString(
  92. sync_pb::WebAppSpecifics::UserDisplayMode user_display_mode);
  93. const char* ProtoEnumToString(
  94. sync_pb::AutofillProfileSpecifics::VerificationStatus status);
  95. const char* ProtoEnumToString(
  96. sync_pb::WifiConfigurationSpecifics::SecurityType security_type);
  97. const char* ProtoEnumToString(
  98. sync_pb::WifiConfigurationSpecifics::AutomaticallyConnectOption
  99. automatically_connect_option);
  100. const char* ProtoEnumToString(
  101. sync_pb::WifiConfigurationSpecifics::IsPreferredOption is_preferred_option);
  102. const char* ProtoEnumToString(
  103. sync_pb::WifiConfigurationSpecifics::MeteredOption metered_option);
  104. const char* ProtoEnumToString(
  105. sync_pb::WifiConfigurationSpecifics::ProxyConfiguration::ProxyOption
  106. proxy_option);
  107. const char* ProtoEnumToString(
  108. sync_pb::WorkspaceDeskSpecifics::WindowState window_state);
  109. const char* ProtoEnumToString(
  110. sync_pb::WorkspaceDeskSpecifics::LaunchContainer container);
  111. const char* ProtoEnumToString(
  112. sync_pb::WorkspaceDeskSpecifics::WindowOpenDisposition disposition);
  113. const char* ProtoEnumToString(
  114. sync_pb::UserConsentTypes::AssistantActivityControlConsent::SettingType
  115. setting_type);
  116. const char* ProtoEnumToString(sync_pb::WorkspaceDeskSpecifics::DeskType type);
  117. const char* ProtoEnumToString(
  118. sync_pb::WorkspaceDeskSpecifics::TabGroupColor color);
  119. } // namespace syncer
  120. #endif // COMPONENTS_SYNC_PROTOCOL_PROTO_ENUM_CONVERSIONS_H_