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

Unified Diff: sync/notifier/sync_notifier_state.cc

Issue 10545170: [Sync] Propagate XMPP auth errors to SyncNotifierObservers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile error Created 8 years, 6 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698