| 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 // Keep this file in sync with the .proto files in this directory. | 5 // Keep this file in sync with the .proto files in this directory. |
| 6 | 6 |
| 7 #include "sync/protocol/proto_enum_conversions.h" | 7 #include "sync/protocol/proto_enum_conversions.h" |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 TYPE_TABBED, TYPE_POPUP); | 26 TYPE_TABBED, TYPE_POPUP); |
| 27 switch (browser_type) { | 27 switch (browser_type) { |
| 28 ENUM_CASE(sync_pb::SessionWindow, TYPE_TABBED); | 28 ENUM_CASE(sync_pb::SessionWindow, TYPE_TABBED); |
| 29 ENUM_CASE(sync_pb::SessionWindow, TYPE_POPUP); | 29 ENUM_CASE(sync_pb::SessionWindow, TYPE_POPUP); |
| 30 } | 30 } |
| 31 NOTREACHED(); | 31 NOTREACHED(); |
| 32 return ""; | 32 return ""; |
| 33 } | 33 } |
| 34 | 34 |
| 35 const char* GetPageTransitionString( | 35 const char* GetPageTransitionString( |
| 36 sync_pb::TabNavigation::PageTransition page_transition) { | 36 sync_pb::SyncEnums::PageTransition page_transition) { |
| 37 ASSERT_ENUM_BOUNDS(sync_pb::TabNavigation, PageTransition, | 37 ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, PageTransition, |
| 38 LINK, CHAIN_END); | 38 LINK, CHAIN_END); |
| 39 switch (page_transition) { | 39 switch (page_transition) { |
| 40 ENUM_CASE(sync_pb::TabNavigation, LINK); | 40 ENUM_CASE(sync_pb::SyncEnums, LINK); |
| 41 ENUM_CASE(sync_pb::TabNavigation, TYPED); | 41 ENUM_CASE(sync_pb::SyncEnums, TYPED); |
| 42 ENUM_CASE(sync_pb::TabNavigation, AUTO_BOOKMARK); | 42 ENUM_CASE(sync_pb::SyncEnums, AUTO_BOOKMARK); |
| 43 ENUM_CASE(sync_pb::TabNavigation, AUTO_SUBFRAME); | 43 ENUM_CASE(sync_pb::SyncEnums, AUTO_SUBFRAME); |
| 44 ENUM_CASE(sync_pb::TabNavigation, MANUAL_SUBFRAME); | 44 ENUM_CASE(sync_pb::SyncEnums, MANUAL_SUBFRAME); |
| 45 ENUM_CASE(sync_pb::TabNavigation, GENERATED); | 45 ENUM_CASE(sync_pb::SyncEnums, GENERATED); |
| 46 ENUM_CASE(sync_pb::TabNavigation, START_PAGE); | 46 ENUM_CASE(sync_pb::SyncEnums, START_PAGE); |
| 47 ENUM_CASE(sync_pb::TabNavigation, FORM_SUBMIT); | 47 ENUM_CASE(sync_pb::SyncEnums, FORM_SUBMIT); |
| 48 ENUM_CASE(sync_pb::TabNavigation, RELOAD); | 48 ENUM_CASE(sync_pb::SyncEnums, RELOAD); |
| 49 ENUM_CASE(sync_pb::TabNavigation, KEYWORD); | 49 ENUM_CASE(sync_pb::SyncEnums, KEYWORD); |
| 50 ENUM_CASE(sync_pb::TabNavigation, KEYWORD_GENERATED); | 50 ENUM_CASE(sync_pb::SyncEnums, KEYWORD_GENERATED); |
| 51 ENUM_CASE(sync_pb::TabNavigation, CHAIN_START); | 51 ENUM_CASE(sync_pb::SyncEnums, CHAIN_START); |
| 52 ENUM_CASE(sync_pb::TabNavigation, CHAIN_END); | 52 ENUM_CASE(sync_pb::SyncEnums, CHAIN_END); |
| 53 } | 53 } |
| 54 NOTREACHED(); | 54 NOTREACHED(); |
| 55 return ""; | 55 return ""; |
| 56 } | 56 } |
| 57 | 57 |
| 58 const char* GetPageTransitionQualifierString( | 58 const char* GetPageTransitionQualifierString( |
| 59 sync_pb::TabNavigation::PageTransitionQualifier | 59 sync_pb::SyncEnums::PageTransitionQualifier |
| 60 page_transition_qualifier) { | 60 page_transition_qualifier) { |
| 61 ASSERT_ENUM_BOUNDS(sync_pb::TabNavigation, PageTransitionQualifier, | 61 ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, PageTransitionQualifier, |
| 62 CLIENT_REDIRECT, SERVER_REDIRECT); | 62 CLIENT_REDIRECT, SERVER_REDIRECT); |
| 63 switch (page_transition_qualifier) { | 63 switch (page_transition_qualifier) { |
| 64 ENUM_CASE(sync_pb::TabNavigation, CLIENT_REDIRECT); | 64 ENUM_CASE(sync_pb::SyncEnums, CLIENT_REDIRECT); |
| 65 ENUM_CASE(sync_pb::TabNavigation, SERVER_REDIRECT); | 65 ENUM_CASE(sync_pb::SyncEnums, SERVER_REDIRECT); |
| 66 } | 66 } |
| 67 NOTREACHED(); | 67 NOTREACHED(); |
| 68 return ""; | 68 return ""; |
| 69 } | 69 } |
| 70 | 70 |
| 71 const char* GetUpdatesSourceString( | 71 const char* GetUpdatesSourceString( |
| 72 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source) { | 72 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source) { |
| 73 ASSERT_ENUM_BOUNDS(sync_pb::GetUpdatesCallerInfo, GetUpdatesSource, | 73 ASSERT_ENUM_BOUNDS(sync_pb::GetUpdatesCallerInfo, GetUpdatesSource, |
| 74 UNKNOWN, DATATYPE_REFRESH); | 74 UNKNOWN, DATATYPE_REFRESH); |
| 75 switch (updates_source) { | 75 switch (updates_source) { |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 ENUM_CASE(sync_pb::SessionTab, TYPE_WEB_FAVICON); | 165 ENUM_CASE(sync_pb::SessionTab, TYPE_WEB_FAVICON); |
| 166 } | 166 } |
| 167 NOTREACHED(); | 167 NOTREACHED(); |
| 168 return ""; | 168 return ""; |
| 169 } | 169 } |
| 170 | 170 |
| 171 #undef ASSERT_ENUM_BOUNDS | 171 #undef ASSERT_ENUM_BOUNDS |
| 172 #undef ENUM_CASE | 172 #undef ENUM_CASE |
| 173 | 173 |
| 174 } // namespace | 174 } // namespace |
| OLD | NEW |