Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / sync / protocol / proto_enum_conversions.h
blobe19fe6bfef302ec0d12d12c4c14994ec0a6efb97
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.
5 #ifndef SYNC_PROTOCOL_PROTO_ENUM_CONVERSIONS_H_
6 #define SYNC_PROTOCOL_PROTO_ENUM_CONVERSIONS_H_
8 // Keep this file in sync with the .proto files in this directory.
10 #include "sync/base/sync_export.h"
11 #include "sync/protocol/app_list_specifics.pb.h"
12 #include "sync/protocol/app_specifics.pb.h"
13 #include "sync/protocol/client_debug_info.pb.h"
14 #include "sync/protocol/session_specifics.pb.h"
15 #include "sync/protocol/sync.pb.h"
17 // Utility functions to get the string equivalent for some sync proto
18 // enums.
20 namespace syncer {
22 // The returned strings (which don't have to be freed) are in ASCII.
23 // The result of passing in an invalid enum value is undefined.
25 SYNC_EXPORT_PRIVATE const char* GetAppListItemTypeString(
26 sync_pb::AppListSpecifics::AppListItemType item_type);
28 SYNC_EXPORT_PRIVATE const char* GetBrowserTypeString(
29 sync_pb::SessionWindow::BrowserType browser_type);
31 SYNC_EXPORT_PRIVATE const char* GetPageTransitionString(
32 sync_pb::SyncEnums::PageTransition page_transition);
34 SYNC_EXPORT_PRIVATE const char* GetPageTransitionRedirectTypeString(
35 sync_pb::SyncEnums::PageTransitionRedirectType
36 redirect_type);
38 SYNC_EXPORT_PRIVATE const char* GetWifiCredentialSecurityClassString(
39 sync_pb::WifiCredentialSpecifics::SecurityClass security_class);
41 SYNC_EXPORT const char* GetUpdatesSourceString(
42 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source);
44 SYNC_EXPORT const char* GetUpdatesOriginString(
45 sync_pb::SyncEnums::GetUpdatesOrigin origin);
47 SYNC_EXPORT_PRIVATE const char* GetResponseTypeString(
48 sync_pb::CommitResponse::ResponseType response_type);
50 SYNC_EXPORT_PRIVATE const char* GetErrorTypeString(
51 sync_pb::SyncEnums::ErrorType error_type);
53 SYNC_EXPORT_PRIVATE const char* GetActionString(
54 sync_pb::SyncEnums::Action action);
56 SYNC_EXPORT_PRIVATE const char* GetLaunchTypeString(
57 sync_pb::AppSpecifics::LaunchType launch_type);
59 SYNC_EXPORT_PRIVATE const char* GetWalletInfoTypeString(
60 sync_pb::AutofillWalletSpecifics::WalletInfoType wallet_info_type);
62 SYNC_EXPORT_PRIVATE const char* GetWalletMetadataTypeString(
63 sync_pb::WalletMetadataSpecifics::Type wallet_metadata_type);
65 SYNC_EXPORT_PRIVATE const char* GetWalletCardStatusString(
66 sync_pb::WalletMaskedCreditCard::WalletCardStatus wallet_card_status);
68 SYNC_EXPORT_PRIVATE const char* GetWalletCardTypeString(
69 sync_pb::WalletMaskedCreditCard::WalletCardType wallet_card_type);
71 const char* GetDeviceTypeString(sync_pb::SyncEnums::DeviceType device_type);
73 const char* GetFaviconTypeString(sync_pb::SessionTab::FaviconType favicon_type);
75 const char* PassphraseTypeString(sync_pb::NigoriSpecifics::PassphraseType type);
77 const char* SingletonDebugEventTypeString(
78 sync_pb::SyncEnums::SingletonDebugEventType type);
80 const char* GetBlockedStateString(sync_pb::TabNavigation::BlockedState state);
82 } // namespace syncer
84 #endif // SYNC_PROTOCOL_PROTO_ENUM_CONVERSIONS_H_