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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, PageTransitionRedirectType, | 73 ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, PageTransitionRedirectType, |
74 CLIENT_REDIRECT, SERVER_REDIRECT); | 74 CLIENT_REDIRECT, SERVER_REDIRECT); |
75 switch (page_transition_qualifier) { | 75 switch (page_transition_qualifier) { |
76 ENUM_CASE(sync_pb::SyncEnums, CLIENT_REDIRECT); | 76 ENUM_CASE(sync_pb::SyncEnums, CLIENT_REDIRECT); |
77 ENUM_CASE(sync_pb::SyncEnums, SERVER_REDIRECT); | 77 ENUM_CASE(sync_pb::SyncEnums, SERVER_REDIRECT); |
78 } | 78 } |
79 NOTREACHED(); | 79 NOTREACHED(); |
80 return ""; | 80 return ""; |
81 } | 81 } |
82 | 82 |
| 83 const char* GetWifiCredentialSecurityClassString( |
| 84 sync_pb::WifiCredentialSpecifics::SecurityClass security_class) { |
| 85 ASSERT_ENUM_BOUNDS(sync_pb::WifiCredentialSpecifics, SecurityClass, |
| 86 SECURITY_CLASS_INVALID, SECURITY_CLASS_PSK); |
| 87 switch (security_class) { |
| 88 ENUM_CASE(sync_pb::WifiCredentialSpecifics, SECURITY_CLASS_INVALID); |
| 89 ENUM_CASE(sync_pb::WifiCredentialSpecifics, SECURITY_CLASS_NONE); |
| 90 ENUM_CASE(sync_pb::WifiCredentialSpecifics, SECURITY_CLASS_WEP); |
| 91 ENUM_CASE(sync_pb::WifiCredentialSpecifics, SECURITY_CLASS_PSK); |
| 92 } |
| 93 NOTREACHED(); |
| 94 return ""; |
| 95 } |
83 const char* GetUpdatesSourceString( | 96 const char* GetUpdatesSourceString( |
84 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source) { | 97 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source) { |
85 ASSERT_ENUM_BOUNDS(sync_pb::GetUpdatesCallerInfo, GetUpdatesSource, | 98 ASSERT_ENUM_BOUNDS(sync_pb::GetUpdatesCallerInfo, GetUpdatesSource, |
86 UNKNOWN, PROGRAMMATIC); | 99 UNKNOWN, PROGRAMMATIC); |
87 switch (updates_source) { | 100 switch (updates_source) { |
88 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, UNKNOWN); | 101 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, UNKNOWN); |
89 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, FIRST_UPDATE); | 102 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, FIRST_UPDATE); |
90 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, LOCAL); | 103 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, LOCAL); |
91 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, NOTIFICATION); | 104 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, NOTIFICATION); |
92 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, PERIODIC); | 105 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, PERIODIC); |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 ENUM_CASE(sync_pb::TabNavigation, STATE_BLOCKED); | 273 ENUM_CASE(sync_pb::TabNavigation, STATE_BLOCKED); |
261 } | 274 } |
262 NOTREACHED(); | 275 NOTREACHED(); |
263 return ""; | 276 return ""; |
264 } | 277 } |
265 | 278 |
266 #undef ASSERT_ENUM_BOUNDS | 279 #undef ASSERT_ENUM_BOUNDS |
267 #undef ENUM_CASE | 280 #undef ENUM_CASE |
268 | 281 |
269 } // namespace syncer | 282 } // namespace syncer |
OLD | NEW |