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

Unified Diff: sync/internal_api/public/util/sync_string_conversions.cc

Issue 10704214: [Sync] Refactor sync manager into interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Comments Created 8 years, 5 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/internal_api/public/util/sync_string_conversions.cc
diff --git a/sync/internal_api/public/util/sync_string_conversions.cc b/sync/internal_api/public/util/sync_string_conversions.cc
new file mode 100644
index 0000000000000000000000000000000000000000..9614203ad140414712eb9ad0fe09a4c2eef69056
--- /dev/null
+++ b/sync/internal_api/public/util/sync_string_conversions.cc
@@ -0,0 +1,39 @@
+// 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/internal_api/public/util/sync_string_conversions.h"
+
+namespace syncer {
+
+const char* ConnectionStatusToString(ConnectionStatus status) {
+ switch (status) {
+ case CONNECTION_OK:
+ return "CONNECTION_OK";
+ case CONNECTION_AUTH_ERROR:
+ return "CONNECTION_AUTH_ERROR";
+ case CONNECTION_SERVER_ERROR:
+ return "CONNECTION_SERVER_ERROR";
+ default:
+ NOTREACHED();
+ return "INVALID_CONNECTION_STATUS";
+ }
+}
+
+// Helper function that converts a PassphraseRequiredReason value to a string.
+const char* PassphraseRequiredReasonToString(
+ PassphraseRequiredReason reason) {
+ switch (reason) {
+ case REASON_PASSPHRASE_NOT_REQUIRED:
+ return "REASON_PASSPHRASE_NOT_REQUIRED";
+ case REASON_ENCRYPTION:
+ return "REASON_ENCRYPTION";
+ case REASON_DECRYPTION:
+ return "REASON_DECRYPTION";
+ default:
+ NOTREACHED();
+ return "INVALID_REASON";
+ }
+}
+
+} // namespace syncer

Powered by Google App Engine
This is Rietveld 408576698