Index: sync/notifier/sync_notifier_state.cc |
diff --git a/sync/notifier/sync_notifier_state.cc b/sync/notifier/sync_notifier_state.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5da32798e3475ba282be7c87b64fdde8f511369b |
--- /dev/null |
+++ b/sync/notifier/sync_notifier_state.cc |
@@ -0,0 +1,41 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "sync/notifier/sync_notifier_state.h" |
+ |
+#include "base/logging.h" |
+ |
+namespace sync_notifier { |
+ |
+const char* SyncNotifierStateToString( |
+ SyncNotifierState sync_notifier_state) { |
+ switch (sync_notifier_state) { |
+ case NOTIFICATIONS_ON: |
+ return "NOTIFICATIONS_ON"; |
+ case NOTIFICATIONS_OFF: |
+ return "NOTIFICATIONS_OFF"; |
+ case CREDENTIALS_REJECTED: |
+ return "CREDENTIALS_REJECTED"; |
+ default: |
+ NOTREACHED(); |
+ return "UNKNOWN"; |
+ } |
+} |
+ |
+SyncNotifierState PushClientStateToSyncNotifierState( |
+ notifier::PushClientState push_client_state) { |
+ switch (push_client_state) { |
+ case notifier::NOTIFICATIONS_ON: |
+ return NOTIFICATIONS_ON; |
+ case notifier::NOTIFICATIONS_OFF: |
+ return NOTIFICATIONS_OFF; |
+ case notifier::CREDENTIALS_REJECTED: |
+ return CREDENTIALS_REJECTED; |
+ default: |
+ NOTREACHED(); |
+ return NOTIFICATIONS_OFF; |
+ } |
+} |
+ |
+} // sync_notifier |