Index: components/sync/protocol/proto_enum_conversions.cc |
diff --git a/sync/protocol/proto_enum_conversions.cc b/components/sync/protocol/proto_enum_conversions.cc |
similarity index 90% |
rename from sync/protocol/proto_enum_conversions.cc |
rename to components/sync/protocol/proto_enum_conversions.cc |
index 84a5b03095995bad76d8ecdb7512c0dad25c279e..627fdba5185df11cf65a3d7a3d5ca1ca543d551c 100644 |
--- a/sync/protocol/proto_enum_conversions.cc |
+++ b/components/sync/protocol/proto_enum_conversions.cc |
@@ -4,7 +4,7 @@ |
// Keep this file in sync with the .proto files in this directory. |
-#include "sync/protocol/proto_enum_conversions.h" |
+#include "components/sync/protocol/proto_enum_conversions.h" |
#include "base/logging.h" |
@@ -16,13 +16,14 @@ namespace syncer { |
static_assert(enum_parent::enum_type##_MAX == enum_parent::enum_max, \ |
#enum_type "_MAX should be " #enum_max); |
-#define ENUM_CASE(enum_parent, enum_value) \ |
- case enum_parent::enum_value: return #enum_value |
+#define ENUM_CASE(enum_parent, enum_value) \ |
+ case enum_parent::enum_value: \ |
+ return #enum_value |
const char* GetAppListItemTypeString( |
sync_pb::AppListSpecifics::AppListItemType item_type) { |
- ASSERT_ENUM_BOUNDS(sync_pb::AppListSpecifics, AppListItemType, |
- TYPE_APP, TYPE_URL); |
+ ASSERT_ENUM_BOUNDS(sync_pb::AppListSpecifics, AppListItemType, TYPE_APP, |
+ TYPE_URL); |
switch (item_type) { |
ENUM_CASE(sync_pb::AppListSpecifics, TYPE_APP); |
ENUM_CASE(sync_pb::AppListSpecifics, TYPE_REMOVE_DEFAULT_APP); |
@@ -35,8 +36,8 @@ const char* GetAppListItemTypeString( |
const char* GetBrowserTypeString( |
sync_pb::SessionWindow::BrowserType browser_type) { |
- ASSERT_ENUM_BOUNDS(sync_pb::SessionWindow, BrowserType, |
- TYPE_TABBED, TYPE_POPUP); |
+ ASSERT_ENUM_BOUNDS(sync_pb::SessionWindow, BrowserType, TYPE_TABBED, |
+ TYPE_POPUP); |
switch (browser_type) { |
ENUM_CASE(sync_pb::SessionWindow, TYPE_TABBED); |
ENUM_CASE(sync_pb::SessionWindow, TYPE_POPUP); |
@@ -47,8 +48,8 @@ const char* GetBrowserTypeString( |
const char* GetPageTransitionString( |
sync_pb::SyncEnums::PageTransition page_transition) { |
- ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, PageTransition, |
- LINK, KEYWORD_GENERATED); |
+ ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, PageTransition, LINK, |
+ KEYWORD_GENERATED); |
switch (page_transition) { |
ENUM_CASE(sync_pb::SyncEnums, LINK); |
ENUM_CASE(sync_pb::SyncEnums, TYPED); |
@@ -67,8 +68,7 @@ const char* GetPageTransitionString( |
} |
const char* GetPageTransitionRedirectTypeString( |
- sync_pb::SyncEnums::PageTransitionRedirectType |
- page_transition_qualifier) { |
+ sync_pb::SyncEnums::PageTransitionRedirectType page_transition_qualifier) { |
ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, PageTransitionRedirectType, |
CLIENT_REDIRECT, SERVER_REDIRECT); |
switch (page_transition_qualifier) { |
@@ -94,8 +94,8 @@ const char* GetWifiCredentialSecurityClassString( |
} |
const char* GetUpdatesSourceString( |
sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source) { |
- ASSERT_ENUM_BOUNDS(sync_pb::GetUpdatesCallerInfo, GetUpdatesSource, |
- UNKNOWN, PROGRAMMATIC); |
+ ASSERT_ENUM_BOUNDS(sync_pb::GetUpdatesCallerInfo, GetUpdatesSource, UNKNOWN, |
+ PROGRAMMATIC); |
switch (updates_source) { |
ENUM_CASE(sync_pb::GetUpdatesCallerInfo, UNKNOWN); |
ENUM_CASE(sync_pb::GetUpdatesCallerInfo, FIRST_UPDATE); |
@@ -117,8 +117,8 @@ const char* GetUpdatesSourceString( |
const char* GetUpdatesOriginString( |
sync_pb::SyncEnums::GetUpdatesOrigin origin) { |
- ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, GetUpdatesOrigin, |
- UNKNOWN_ORIGIN, PROGRAMMATIC); |
+ ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, GetUpdatesOrigin, UNKNOWN_ORIGIN, |
+ PROGRAMMATIC); |
switch (origin) { |
ENUM_CASE(sync_pb::SyncEnums, UNKNOWN_ORIGIN); |
ENUM_CASE(sync_pb::SyncEnums, PERIODIC); |
@@ -174,8 +174,8 @@ const char* GetErrorTypeString(sync_pb::SyncEnums::ErrorType error_type) { |
} |
const char* GetActionString(sync_pb::SyncEnums::Action action) { |
- ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, Action, |
- UPGRADE_CLIENT, UNKNOWN_ACTION); |
+ ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, Action, UPGRADE_CLIENT, |
+ UNKNOWN_ACTION); |
switch (action) { |
ENUM_CASE(sync_pb::SyncEnums, UPGRADE_CLIENT); |
ENUM_CASE(sync_pb::SyncEnums, CLEAR_USER_DATA_AND_RESYNC); |
@@ -202,8 +202,8 @@ const char* GetLaunchTypeString(sync_pb::AppSpecifics::LaunchType launch_type) { |
const char* GetWalletInfoTypeString( |
sync_pb::AutofillWalletSpecifics::WalletInfoType wallet_info_type) { |
- ASSERT_ENUM_BOUNDS(sync_pb::AutofillWalletSpecifics, WalletInfoType, |
- UNKNOWN, POSTAL_ADDRESS); |
+ ASSERT_ENUM_BOUNDS(sync_pb::AutofillWalletSpecifics, WalletInfoType, UNKNOWN, |
+ POSTAL_ADDRESS); |
switch (wallet_info_type) { |
ENUM_CASE(sync_pb::AutofillWalletSpecifics, UNKNOWN); |
ENUM_CASE(sync_pb::AutofillWalletSpecifics, MASKED_CREDIT_CARD); |
@@ -252,8 +252,7 @@ const char* GetWalletCardTypeString( |
return ""; |
} |
-const char* GetDeviceTypeString( |
- sync_pb::SyncEnums::DeviceType device_type) { |
+const char* GetDeviceTypeString(sync_pb::SyncEnums::DeviceType device_type) { |
ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, DeviceType, TYPE_WIN, TYPE_TABLET); |
switch (device_type) { |
ENUM_CASE(sync_pb::SyncEnums, TYPE_WIN); |
@@ -272,9 +271,7 @@ const char* GetFaviconTypeString( |
sync_pb::SessionTab::FaviconType favicon_type) { |
ASSERT_ENUM_BOUNDS(sync_pb::SessionTab, FaviconType, TYPE_WEB_FAVICON, |
TYPE_WEB_FAVICON); |
- switch (favicon_type) { |
- ENUM_CASE(sync_pb::SessionTab, TYPE_WEB_FAVICON); |
- } |
+ switch (favicon_type) { ENUM_CASE(sync_pb::SessionTab, TYPE_WEB_FAVICON); } |
NOTREACHED(); |
return ""; |
} |
@@ -316,10 +313,9 @@ const char* SingletonDebugEventTypeString( |
return ""; |
} |
-const char* GetBlockedStateString( |
- sync_pb::TabNavigation::BlockedState state) { |
- ASSERT_ENUM_BOUNDS(sync_pb::TabNavigation, BlockedState, |
- STATE_ALLOWED, STATE_BLOCKED); |
+const char* GetBlockedStateString(sync_pb::TabNavigation::BlockedState state) { |
+ ASSERT_ENUM_BOUNDS(sync_pb::TabNavigation, BlockedState, STATE_ALLOWED, |
+ STATE_BLOCKED); |
switch (state) { |
ENUM_CASE(sync_pb::TabNavigation, STATE_ALLOWED); |
ENUM_CASE(sync_pb::TabNavigation, STATE_BLOCKED); |