summaryrefslogtreecommitdiffstats
path: root/sync/internal_api/public/util/sync_string_conversions.cc
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-17 20:12:15 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-17 20:12:15 +0000
commitceffdf01e68f732b0aa5731274dbf3d32a27ffde (patch)
tree22976ce293d7bdfd20871a2d1f28524d441157cf /sync/internal_api/public/util/sync_string_conversions.cc
parent3cf1e5d278ee73b5c3365b35614091858b9f5d1a (diff)
downloadchromium_src-ceffdf01e68f732b0aa5731274dbf3d32a27ffde.zip
chromium_src-ceffdf01e68f732b0aa5731274dbf3d32a27ffde.tar.gz
chromium_src-ceffdf01e68f732b0aa5731274dbf3d32a27ffde.tar.bz2
[Sync] Refactor sync manager into interface.
sync_manager.h now defines a pure interface. The actual implementation is in sync_manager_impl.h/cc. In order to support this, we also create a SyncManagerFactory, which allows us to dependency inject a SyncManager implementation into the SyncBackendHost. Follow up patches will make use of this injection, as well as split the SyncManager tests out of syncapi_unittest. R=akalin@chromium.org BUG=133061 TEST= Review URL: https://chromiumcodereview.appspot.com/10704214 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@147076 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'sync/internal_api/public/util/sync_string_conversions.cc')
-rw-r--r--sync/internal_api/public/util/sync_string_conversions.cc39
1 files changed, 39 insertions, 0 deletions
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 0000000..9614203
--- /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