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/enhanced_bookmark_specifics.pb.h"
15 #include "sync/protocol/session_specifics.pb.h"
16 #include "sync/protocol/sync.pb.h"
18 // Utility functions to get the string equivalent for some sync proto
23 // The returned strings (which don't have to be freed) are in ASCII.
24 // The result of passing in an invalid enum value is undefined.
26 SYNC_EXPORT_PRIVATE
const char* GetAppListItemTypeString(
27 sync_pb::AppListSpecifics::AppListItemType item_type
);
29 SYNC_EXPORT_PRIVATE
const char* GetBrowserTypeString(
30 sync_pb::SessionWindow::BrowserType browser_type
);
32 SYNC_EXPORT_PRIVATE
const char* GetPageTransitionString(
33 sync_pb::SyncEnums::PageTransition page_transition
);
35 SYNC_EXPORT_PRIVATE
const char* GetPageTransitionRedirectTypeString(
36 sync_pb::SyncEnums::PageTransitionRedirectType
39 SYNC_EXPORT
const char* GetUpdatesSourceString(
40 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source
);
42 SYNC_EXPORT
const char* GetUpdatesOriginString(
43 sync_pb::SyncEnums::GetUpdatesOrigin origin
);
45 SYNC_EXPORT_PRIVATE
const char* GetResponseTypeString(
46 sync_pb::CommitResponse::ResponseType response_type
);
48 SYNC_EXPORT_PRIVATE
const char* GetErrorTypeString(
49 sync_pb::SyncEnums::ErrorType error_type
);
51 SYNC_EXPORT_PRIVATE
const char* GetActionString(
52 sync_pb::SyncEnums::Action action
);
54 SYNC_EXPORT_PRIVATE
const char* GetLaunchTypeString(
55 sync_pb::AppSpecifics::LaunchType launch_type
);
58 const char* GetDeviceTypeString(sync_pb::SyncEnums::DeviceType device_type
);
60 const char* GetFaviconTypeString(sync_pb::SessionTab::FaviconType favicon_type
);
62 const char* PassphraseTypeString(sync_pb::NigoriSpecifics::PassphraseType type
);
64 const char* SingletonDebugEventTypeString(
65 sync_pb::SyncEnums::SingletonDebugEventType type
);
67 const char* GetBlockedStateString(sync_pb::TabNavigation::BlockedState state
);
69 const char* GetDisplaySizeString(
70 sync_pb::ChromeSyncFolioInfo::DisplaySize display_size
);
72 const char* GetFetchErrorReasonString(
73 sync_pb::ChromeSyncClip::FetchErrorReason fetch_error_reason
);
77 #endif // SYNC_PROTOCOL_PROTO_ENUM_CONVERSIONS_H_