OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "sync/notifier/sync_notifier_state.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace sync_notifier { |
| 10 |
| 11 const char* SyncNotifierStateToString( |
| 12 SyncNotifierState sync_notifier_state) { |
| 13 switch (sync_notifier_state) { |
| 14 case NOTIFICATIONS_ON: |
| 15 return "NOTIFICATIONS_ON"; |
| 16 case NOTIFICATIONS_OFF: |
| 17 return "NOTIFICATIONS_OFF"; |
| 18 case CREDENTIALS_REJECTED: |
| 19 return "CREDENTIALS_REJECTED"; |
| 20 default: |
| 21 NOTREACHED(); |
| 22 return "UNKNOWN"; |
| 23 } |
| 24 } |
| 25 |
| 26 SyncNotifierState PushClientStateToSyncNotifierState( |
| 27 notifier::PushClientState push_client_state) { |
| 28 switch (push_client_state) { |
| 29 case notifier::NOTIFICATIONS_ON: |
| 30 return NOTIFICATIONS_ON; |
| 31 case notifier::NOTIFICATIONS_OFF: |
| 32 return NOTIFICATIONS_OFF; |
| 33 case notifier::CREDENTIALS_REJECTED: |
| 34 return CREDENTIALS_REJECTED; |
| 35 default: |
| 36 NOTREACHED(); |
| 37 return NOTIFICATIONS_OFF; |
| 38 } |
| 39 } |
| 40 |
| 41 } // sync_notifier |
OLD | NEW |