Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(79)

Side by Side Diff: components/sync/protocol/proto_enum_conversions.cc

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/sync/protocol/proto_enum_conversions.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
11 namespace syncer { 11 namespace syncer {
12 12
13 #define ASSERT_ENUM_BOUNDS(enum_parent, enum_type, enum_min, enum_max) \ 13 #define ASSERT_ENUM_BOUNDS(enum_parent, enum_type, enum_min, enum_max) \
14 static_assert(enum_parent::enum_type##_MIN == enum_parent::enum_min, \ 14 static_assert(enum_parent::enum_type##_MIN == enum_parent::enum_min, \
15 #enum_type "_MIN should be " #enum_min); \ 15 #enum_type "_MIN should be " #enum_min); \
16 static_assert(enum_parent::enum_type##_MAX == enum_parent::enum_max, \ 16 static_assert(enum_parent::enum_type##_MAX == enum_parent::enum_max, \
17 #enum_type "_MAX should be " #enum_max); 17 #enum_type "_MAX should be " #enum_max);
18 18
19 #define ENUM_CASE(enum_parent, enum_value) \ 19 #define ENUM_CASE(enum_parent, enum_value) \
20 case enum_parent::enum_value: return #enum_value 20 case enum_parent::enum_value: \
21 return #enum_value
21 22
22 const char* GetAppListItemTypeString( 23 const char* GetAppListItemTypeString(
23 sync_pb::AppListSpecifics::AppListItemType item_type) { 24 sync_pb::AppListSpecifics::AppListItemType item_type) {
24 ASSERT_ENUM_BOUNDS(sync_pb::AppListSpecifics, AppListItemType, 25 ASSERT_ENUM_BOUNDS(sync_pb::AppListSpecifics, AppListItemType, TYPE_APP,
25 TYPE_APP, TYPE_URL); 26 TYPE_URL);
26 switch (item_type) { 27 switch (item_type) {
27 ENUM_CASE(sync_pb::AppListSpecifics, TYPE_APP); 28 ENUM_CASE(sync_pb::AppListSpecifics, TYPE_APP);
28 ENUM_CASE(sync_pb::AppListSpecifics, TYPE_REMOVE_DEFAULT_APP); 29 ENUM_CASE(sync_pb::AppListSpecifics, TYPE_REMOVE_DEFAULT_APP);
29 ENUM_CASE(sync_pb::AppListSpecifics, TYPE_FOLDER); 30 ENUM_CASE(sync_pb::AppListSpecifics, TYPE_FOLDER);
30 ENUM_CASE(sync_pb::AppListSpecifics, TYPE_URL); 31 ENUM_CASE(sync_pb::AppListSpecifics, TYPE_URL);
31 } 32 }
32 NOTREACHED(); 33 NOTREACHED();
33 return ""; 34 return "";
34 } 35 }
35 36
36 const char* GetBrowserTypeString( 37 const char* GetBrowserTypeString(
37 sync_pb::SessionWindow::BrowserType browser_type) { 38 sync_pb::SessionWindow::BrowserType browser_type) {
38 ASSERT_ENUM_BOUNDS(sync_pb::SessionWindow, BrowserType, 39 ASSERT_ENUM_BOUNDS(sync_pb::SessionWindow, BrowserType, TYPE_TABBED,
39 TYPE_TABBED, TYPE_POPUP); 40 TYPE_POPUP);
40 switch (browser_type) { 41 switch (browser_type) {
41 ENUM_CASE(sync_pb::SessionWindow, TYPE_TABBED); 42 ENUM_CASE(sync_pb::SessionWindow, TYPE_TABBED);
42 ENUM_CASE(sync_pb::SessionWindow, TYPE_POPUP); 43 ENUM_CASE(sync_pb::SessionWindow, TYPE_POPUP);
43 } 44 }
44 NOTREACHED(); 45 NOTREACHED();
45 return ""; 46 return "";
46 } 47 }
47 48
48 const char* GetPageTransitionString( 49 const char* GetPageTransitionString(
49 sync_pb::SyncEnums::PageTransition page_transition) { 50 sync_pb::SyncEnums::PageTransition page_transition) {
50 ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, PageTransition, 51 ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, PageTransition, LINK,
51 LINK, KEYWORD_GENERATED); 52 KEYWORD_GENERATED);
52 switch (page_transition) { 53 switch (page_transition) {
53 ENUM_CASE(sync_pb::SyncEnums, LINK); 54 ENUM_CASE(sync_pb::SyncEnums, LINK);
54 ENUM_CASE(sync_pb::SyncEnums, TYPED); 55 ENUM_CASE(sync_pb::SyncEnums, TYPED);
55 ENUM_CASE(sync_pb::SyncEnums, AUTO_BOOKMARK); 56 ENUM_CASE(sync_pb::SyncEnums, AUTO_BOOKMARK);
56 ENUM_CASE(sync_pb::SyncEnums, AUTO_SUBFRAME); 57 ENUM_CASE(sync_pb::SyncEnums, AUTO_SUBFRAME);
57 ENUM_CASE(sync_pb::SyncEnums, MANUAL_SUBFRAME); 58 ENUM_CASE(sync_pb::SyncEnums, MANUAL_SUBFRAME);
58 ENUM_CASE(sync_pb::SyncEnums, GENERATED); 59 ENUM_CASE(sync_pb::SyncEnums, GENERATED);
59 ENUM_CASE(sync_pb::SyncEnums, AUTO_TOPLEVEL); 60 ENUM_CASE(sync_pb::SyncEnums, AUTO_TOPLEVEL);
60 ENUM_CASE(sync_pb::SyncEnums, FORM_SUBMIT); 61 ENUM_CASE(sync_pb::SyncEnums, FORM_SUBMIT);
61 ENUM_CASE(sync_pb::SyncEnums, RELOAD); 62 ENUM_CASE(sync_pb::SyncEnums, RELOAD);
62 ENUM_CASE(sync_pb::SyncEnums, KEYWORD); 63 ENUM_CASE(sync_pb::SyncEnums, KEYWORD);
63 ENUM_CASE(sync_pb::SyncEnums, KEYWORD_GENERATED); 64 ENUM_CASE(sync_pb::SyncEnums, KEYWORD_GENERATED);
64 } 65 }
65 NOTREACHED(); 66 NOTREACHED();
66 return ""; 67 return "";
67 } 68 }
68 69
69 const char* GetPageTransitionRedirectTypeString( 70 const char* GetPageTransitionRedirectTypeString(
70 sync_pb::SyncEnums::PageTransitionRedirectType 71 sync_pb::SyncEnums::PageTransitionRedirectType page_transition_qualifier) {
71 page_transition_qualifier) {
72 ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, PageTransitionRedirectType, 72 ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, PageTransitionRedirectType,
73 CLIENT_REDIRECT, SERVER_REDIRECT); 73 CLIENT_REDIRECT, SERVER_REDIRECT);
74 switch (page_transition_qualifier) { 74 switch (page_transition_qualifier) {
75 ENUM_CASE(sync_pb::SyncEnums, CLIENT_REDIRECT); 75 ENUM_CASE(sync_pb::SyncEnums, CLIENT_REDIRECT);
76 ENUM_CASE(sync_pb::SyncEnums, SERVER_REDIRECT); 76 ENUM_CASE(sync_pb::SyncEnums, SERVER_REDIRECT);
77 } 77 }
78 NOTREACHED(); 78 NOTREACHED();
79 return ""; 79 return "";
80 } 80 }
81 81
82 const char* GetWifiCredentialSecurityClassString( 82 const char* GetWifiCredentialSecurityClassString(
83 sync_pb::WifiCredentialSpecifics::SecurityClass security_class) { 83 sync_pb::WifiCredentialSpecifics::SecurityClass security_class) {
84 ASSERT_ENUM_BOUNDS(sync_pb::WifiCredentialSpecifics, SecurityClass, 84 ASSERT_ENUM_BOUNDS(sync_pb::WifiCredentialSpecifics, SecurityClass,
85 SECURITY_CLASS_INVALID, SECURITY_CLASS_PSK); 85 SECURITY_CLASS_INVALID, SECURITY_CLASS_PSK);
86 switch (security_class) { 86 switch (security_class) {
87 ENUM_CASE(sync_pb::WifiCredentialSpecifics, SECURITY_CLASS_INVALID); 87 ENUM_CASE(sync_pb::WifiCredentialSpecifics, SECURITY_CLASS_INVALID);
88 ENUM_CASE(sync_pb::WifiCredentialSpecifics, SECURITY_CLASS_NONE); 88 ENUM_CASE(sync_pb::WifiCredentialSpecifics, SECURITY_CLASS_NONE);
89 ENUM_CASE(sync_pb::WifiCredentialSpecifics, SECURITY_CLASS_WEP); 89 ENUM_CASE(sync_pb::WifiCredentialSpecifics, SECURITY_CLASS_WEP);
90 ENUM_CASE(sync_pb::WifiCredentialSpecifics, SECURITY_CLASS_PSK); 90 ENUM_CASE(sync_pb::WifiCredentialSpecifics, SECURITY_CLASS_PSK);
91 } 91 }
92 NOTREACHED(); 92 NOTREACHED();
93 return ""; 93 return "";
94 } 94 }
95 const char* GetUpdatesSourceString( 95 const char* GetUpdatesSourceString(
96 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source) { 96 sync_pb::GetUpdatesCallerInfo::GetUpdatesSource updates_source) {
97 ASSERT_ENUM_BOUNDS(sync_pb::GetUpdatesCallerInfo, GetUpdatesSource, 97 ASSERT_ENUM_BOUNDS(sync_pb::GetUpdatesCallerInfo, GetUpdatesSource, UNKNOWN,
98 UNKNOWN, PROGRAMMATIC); 98 PROGRAMMATIC);
99 switch (updates_source) { 99 switch (updates_source) {
100 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, UNKNOWN); 100 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, UNKNOWN);
101 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, FIRST_UPDATE); 101 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, FIRST_UPDATE);
102 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, LOCAL); 102 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, LOCAL);
103 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, NOTIFICATION); 103 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, NOTIFICATION);
104 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, PERIODIC); 104 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, PERIODIC);
105 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, SYNC_CYCLE_CONTINUATION); 105 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, SYNC_CYCLE_CONTINUATION);
106 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, NEWLY_SUPPORTED_DATATYPE); 106 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, NEWLY_SUPPORTED_DATATYPE);
107 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, MIGRATION); 107 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, MIGRATION);
108 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, NEW_CLIENT); 108 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, NEW_CLIENT);
109 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, RECONFIGURATION); 109 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, RECONFIGURATION);
110 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, DATATYPE_REFRESH); 110 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, DATATYPE_REFRESH);
111 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, RETRY); 111 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, RETRY);
112 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, PROGRAMMATIC); 112 ENUM_CASE(sync_pb::GetUpdatesCallerInfo, PROGRAMMATIC);
113 } 113 }
114 NOTREACHED(); 114 NOTREACHED();
115 return ""; 115 return "";
116 } 116 }
117 117
118 const char* GetUpdatesOriginString( 118 const char* GetUpdatesOriginString(
119 sync_pb::SyncEnums::GetUpdatesOrigin origin) { 119 sync_pb::SyncEnums::GetUpdatesOrigin origin) {
120 ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, GetUpdatesOrigin, 120 ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, GetUpdatesOrigin, UNKNOWN_ORIGIN,
121 UNKNOWN_ORIGIN, PROGRAMMATIC); 121 PROGRAMMATIC);
122 switch (origin) { 122 switch (origin) {
123 ENUM_CASE(sync_pb::SyncEnums, UNKNOWN_ORIGIN); 123 ENUM_CASE(sync_pb::SyncEnums, UNKNOWN_ORIGIN);
124 ENUM_CASE(sync_pb::SyncEnums, PERIODIC); 124 ENUM_CASE(sync_pb::SyncEnums, PERIODIC);
125 ENUM_CASE(sync_pb::SyncEnums, NEWLY_SUPPORTED_DATATYPE); 125 ENUM_CASE(sync_pb::SyncEnums, NEWLY_SUPPORTED_DATATYPE);
126 ENUM_CASE(sync_pb::SyncEnums, MIGRATION); 126 ENUM_CASE(sync_pb::SyncEnums, MIGRATION);
127 ENUM_CASE(sync_pb::SyncEnums, NEW_CLIENT); 127 ENUM_CASE(sync_pb::SyncEnums, NEW_CLIENT);
128 ENUM_CASE(sync_pb::SyncEnums, RECONFIGURATION); 128 ENUM_CASE(sync_pb::SyncEnums, RECONFIGURATION);
129 ENUM_CASE(sync_pb::SyncEnums, GU_TRIGGER); 129 ENUM_CASE(sync_pb::SyncEnums, GU_TRIGGER);
130 ENUM_CASE(sync_pb::SyncEnums, RETRY); 130 ENUM_CASE(sync_pb::SyncEnums, RETRY);
131 ENUM_CASE(sync_pb::SyncEnums, PROGRAMMATIC); 131 ENUM_CASE(sync_pb::SyncEnums, PROGRAMMATIC);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 ENUM_CASE(sync_pb::SyncEnums, DEPRECATED_USER_ROLLBACK); 167 ENUM_CASE(sync_pb::SyncEnums, DEPRECATED_USER_ROLLBACK);
168 ENUM_CASE(sync_pb::SyncEnums, PARTIAL_FAILURE); 168 ENUM_CASE(sync_pb::SyncEnums, PARTIAL_FAILURE);
169 ENUM_CASE(sync_pb::SyncEnums, CLIENT_DATA_OBSOLETE); 169 ENUM_CASE(sync_pb::SyncEnums, CLIENT_DATA_OBSOLETE);
170 ENUM_CASE(sync_pb::SyncEnums, UNKNOWN); 170 ENUM_CASE(sync_pb::SyncEnums, UNKNOWN);
171 } 171 }
172 NOTREACHED(); 172 NOTREACHED();
173 return ""; 173 return "";
174 } 174 }
175 175
176 const char* GetActionString(sync_pb::SyncEnums::Action action) { 176 const char* GetActionString(sync_pb::SyncEnums::Action action) {
177 ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, Action, 177 ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, Action, UPGRADE_CLIENT,
178 UPGRADE_CLIENT, UNKNOWN_ACTION); 178 UNKNOWN_ACTION);
179 switch (action) { 179 switch (action) {
180 ENUM_CASE(sync_pb::SyncEnums, UPGRADE_CLIENT); 180 ENUM_CASE(sync_pb::SyncEnums, UPGRADE_CLIENT);
181 ENUM_CASE(sync_pb::SyncEnums, CLEAR_USER_DATA_AND_RESYNC); 181 ENUM_CASE(sync_pb::SyncEnums, CLEAR_USER_DATA_AND_RESYNC);
182 ENUM_CASE(sync_pb::SyncEnums, ENABLE_SYNC_ON_ACCOUNT); 182 ENUM_CASE(sync_pb::SyncEnums, ENABLE_SYNC_ON_ACCOUNT);
183 ENUM_CASE(sync_pb::SyncEnums, STOP_AND_RESTART_SYNC); 183 ENUM_CASE(sync_pb::SyncEnums, STOP_AND_RESTART_SYNC);
184 ENUM_CASE(sync_pb::SyncEnums, DISABLE_SYNC_ON_CLIENT); 184 ENUM_CASE(sync_pb::SyncEnums, DISABLE_SYNC_ON_CLIENT);
185 ENUM_CASE(sync_pb::SyncEnums, UNKNOWN_ACTION); 185 ENUM_CASE(sync_pb::SyncEnums, UNKNOWN_ACTION);
186 } 186 }
187 NOTREACHED(); 187 NOTREACHED();
188 return ""; 188 return "";
189 } 189 }
190 190
191 const char* GetLaunchTypeString(sync_pb::AppSpecifics::LaunchType launch_type) { 191 const char* GetLaunchTypeString(sync_pb::AppSpecifics::LaunchType launch_type) {
192 ASSERT_ENUM_BOUNDS(sync_pb::AppSpecifics, LaunchType, PINNED, WINDOW); 192 ASSERT_ENUM_BOUNDS(sync_pb::AppSpecifics, LaunchType, PINNED, WINDOW);
193 switch (launch_type) { 193 switch (launch_type) {
194 ENUM_CASE(sync_pb::AppSpecifics, PINNED); 194 ENUM_CASE(sync_pb::AppSpecifics, PINNED);
195 ENUM_CASE(sync_pb::AppSpecifics, REGULAR); 195 ENUM_CASE(sync_pb::AppSpecifics, REGULAR);
196 ENUM_CASE(sync_pb::AppSpecifics, FULLSCREEN); 196 ENUM_CASE(sync_pb::AppSpecifics, FULLSCREEN);
197 ENUM_CASE(sync_pb::AppSpecifics, WINDOW); 197 ENUM_CASE(sync_pb::AppSpecifics, WINDOW);
198 } 198 }
199 NOTREACHED(); 199 NOTREACHED();
200 return ""; 200 return "";
201 } 201 }
202 202
203 const char* GetWalletInfoTypeString( 203 const char* GetWalletInfoTypeString(
204 sync_pb::AutofillWalletSpecifics::WalletInfoType wallet_info_type) { 204 sync_pb::AutofillWalletSpecifics::WalletInfoType wallet_info_type) {
205 ASSERT_ENUM_BOUNDS(sync_pb::AutofillWalletSpecifics, WalletInfoType, 205 ASSERT_ENUM_BOUNDS(sync_pb::AutofillWalletSpecifics, WalletInfoType, UNKNOWN,
206 UNKNOWN, POSTAL_ADDRESS); 206 POSTAL_ADDRESS);
207 switch (wallet_info_type) { 207 switch (wallet_info_type) {
208 ENUM_CASE(sync_pb::AutofillWalletSpecifics, UNKNOWN); 208 ENUM_CASE(sync_pb::AutofillWalletSpecifics, UNKNOWN);
209 ENUM_CASE(sync_pb::AutofillWalletSpecifics, MASKED_CREDIT_CARD); 209 ENUM_CASE(sync_pb::AutofillWalletSpecifics, MASKED_CREDIT_CARD);
210 ENUM_CASE(sync_pb::AutofillWalletSpecifics, POSTAL_ADDRESS); 210 ENUM_CASE(sync_pb::AutofillWalletSpecifics, POSTAL_ADDRESS);
211 } 211 }
212 NOTREACHED(); 212 NOTREACHED();
213 return ""; 213 return "";
214 } 214 }
215 215
216 const char* GetWalletMetadataTypeString( 216 const char* GetWalletMetadataTypeString(
(...skipping 28 matching lines...) Expand all
245 ENUM_CASE(sync_pb::WalletMaskedCreditCard, MAESTRO); 245 ENUM_CASE(sync_pb::WalletMaskedCreditCard, MAESTRO);
246 ENUM_CASE(sync_pb::WalletMaskedCreditCard, MASTER_CARD); 246 ENUM_CASE(sync_pb::WalletMaskedCreditCard, MASTER_CARD);
247 ENUM_CASE(sync_pb::WalletMaskedCreditCard, SOLO); 247 ENUM_CASE(sync_pb::WalletMaskedCreditCard, SOLO);
248 ENUM_CASE(sync_pb::WalletMaskedCreditCard, SWITCH); 248 ENUM_CASE(sync_pb::WalletMaskedCreditCard, SWITCH);
249 ENUM_CASE(sync_pb::WalletMaskedCreditCard, VISA); 249 ENUM_CASE(sync_pb::WalletMaskedCreditCard, VISA);
250 } 250 }
251 NOTREACHED(); 251 NOTREACHED();
252 return ""; 252 return "";
253 } 253 }
254 254
255 const char* GetDeviceTypeString( 255 const char* GetDeviceTypeString(sync_pb::SyncEnums::DeviceType device_type) {
256 sync_pb::SyncEnums::DeviceType device_type) {
257 ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, DeviceType, TYPE_WIN, TYPE_TABLET); 256 ASSERT_ENUM_BOUNDS(sync_pb::SyncEnums, DeviceType, TYPE_WIN, TYPE_TABLET);
258 switch (device_type) { 257 switch (device_type) {
259 ENUM_CASE(sync_pb::SyncEnums, TYPE_WIN); 258 ENUM_CASE(sync_pb::SyncEnums, TYPE_WIN);
260 ENUM_CASE(sync_pb::SyncEnums, TYPE_MAC); 259 ENUM_CASE(sync_pb::SyncEnums, TYPE_MAC);
261 ENUM_CASE(sync_pb::SyncEnums, TYPE_LINUX); 260 ENUM_CASE(sync_pb::SyncEnums, TYPE_LINUX);
262 ENUM_CASE(sync_pb::SyncEnums, TYPE_CROS); 261 ENUM_CASE(sync_pb::SyncEnums, TYPE_CROS);
263 ENUM_CASE(sync_pb::SyncEnums, TYPE_OTHER); 262 ENUM_CASE(sync_pb::SyncEnums, TYPE_OTHER);
264 ENUM_CASE(sync_pb::SyncEnums, TYPE_PHONE); 263 ENUM_CASE(sync_pb::SyncEnums, TYPE_PHONE);
265 ENUM_CASE(sync_pb::SyncEnums, TYPE_TABLET); 264 ENUM_CASE(sync_pb::SyncEnums, TYPE_TABLET);
266 } 265 }
267 NOTREACHED(); 266 NOTREACHED();
268 return ""; 267 return "";
269 } 268 }
270 269
271 const char* GetFaviconTypeString( 270 const char* GetFaviconTypeString(
272 sync_pb::SessionTab::FaviconType favicon_type) { 271 sync_pb::SessionTab::FaviconType favicon_type) {
273 ASSERT_ENUM_BOUNDS(sync_pb::SessionTab, FaviconType, TYPE_WEB_FAVICON, 272 ASSERT_ENUM_BOUNDS(sync_pb::SessionTab, FaviconType, TYPE_WEB_FAVICON,
274 TYPE_WEB_FAVICON); 273 TYPE_WEB_FAVICON);
275 switch (favicon_type) { 274 switch (favicon_type) { ENUM_CASE(sync_pb::SessionTab, TYPE_WEB_FAVICON); }
276 ENUM_CASE(sync_pb::SessionTab, TYPE_WEB_FAVICON);
277 }
278 NOTREACHED(); 275 NOTREACHED();
279 return ""; 276 return "";
280 } 277 }
281 278
282 const char* PassphraseTypeString( 279 const char* PassphraseTypeString(
283 sync_pb::NigoriSpecifics::PassphraseType type) { 280 sync_pb::NigoriSpecifics::PassphraseType type) {
284 ASSERT_ENUM_BOUNDS(sync_pb::NigoriSpecifics, PassphraseType, 281 ASSERT_ENUM_BOUNDS(sync_pb::NigoriSpecifics, PassphraseType,
285 IMPLICIT_PASSPHRASE, CUSTOM_PASSPHRASE); 282 IMPLICIT_PASSPHRASE, CUSTOM_PASSPHRASE);
286 switch (type) { 283 switch (type) {
287 ENUM_CASE(sync_pb::NigoriSpecifics, IMPLICIT_PASSPHRASE); 284 ENUM_CASE(sync_pb::NigoriSpecifics, IMPLICIT_PASSPHRASE);
(...skipping 21 matching lines...) Expand all
309 ENUM_CASE(sync_pb::SyncEnums, ENCRYPTED_TYPES_CHANGED); 306 ENUM_CASE(sync_pb::SyncEnums, ENCRYPTED_TYPES_CHANGED);
310 ENUM_CASE(sync_pb::SyncEnums, PASSPHRASE_TYPE_CHANGED); 307 ENUM_CASE(sync_pb::SyncEnums, PASSPHRASE_TYPE_CHANGED);
311 ENUM_CASE(sync_pb::SyncEnums, KEYSTORE_TOKEN_UPDATED); 308 ENUM_CASE(sync_pb::SyncEnums, KEYSTORE_TOKEN_UPDATED);
312 ENUM_CASE(sync_pb::SyncEnums, CONFIGURE_COMPLETE); 309 ENUM_CASE(sync_pb::SyncEnums, CONFIGURE_COMPLETE);
313 ENUM_CASE(sync_pb::SyncEnums, BOOTSTRAP_TOKEN_UPDATED); 310 ENUM_CASE(sync_pb::SyncEnums, BOOTSTRAP_TOKEN_UPDATED);
314 } 311 }
315 NOTREACHED(); 312 NOTREACHED();
316 return ""; 313 return "";
317 } 314 }
318 315
319 const char* GetBlockedStateString( 316 const char* GetBlockedStateString(sync_pb::TabNavigation::BlockedState state) {
320 sync_pb::TabNavigation::BlockedState state) { 317 ASSERT_ENUM_BOUNDS(sync_pb::TabNavigation, BlockedState, STATE_ALLOWED,
321 ASSERT_ENUM_BOUNDS(sync_pb::TabNavigation, BlockedState, 318 STATE_BLOCKED);
322 STATE_ALLOWED, STATE_BLOCKED);
323 switch (state) { 319 switch (state) {
324 ENUM_CASE(sync_pb::TabNavigation, STATE_ALLOWED); 320 ENUM_CASE(sync_pb::TabNavigation, STATE_ALLOWED);
325 ENUM_CASE(sync_pb::TabNavigation, STATE_BLOCKED); 321 ENUM_CASE(sync_pb::TabNavigation, STATE_BLOCKED);
326 } 322 }
327 NOTREACHED(); 323 NOTREACHED();
328 return ""; 324 return "";
329 } 325 }
330 326
331 #undef ASSERT_ENUM_BOUNDS 327 #undef ASSERT_ENUM_BOUNDS
332 #undef ENUM_CASE 328 #undef ENUM_CASE
333 329
334 } // namespace syncer 330 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/protocol/proto_enum_conversions.h ('k') | components/sync/protocol/proto_enum_conversions_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698