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/internal_api/public/util/sync_string_conversions.h" |
| 6 |
| 7 namespace syncer { |
| 8 |
| 9 const char* ConnectionStatusToString(ConnectionStatus status) { |
| 10 switch (status) { |
| 11 case CONNECTION_OK: |
| 12 return "CONNECTION_OK"; |
| 13 case CONNECTION_AUTH_ERROR: |
| 14 return "CONNECTION_AUTH_ERROR"; |
| 15 case CONNECTION_SERVER_ERROR: |
| 16 return "CONNECTION_SERVER_ERROR"; |
| 17 default: |
| 18 NOTREACHED(); |
| 19 return "INVALID_CONNECTION_STATUS"; |
| 20 } |
| 21 } |
| 22 |
| 23 // Helper function that converts a PassphraseRequiredReason value to a string. |
| 24 const char* PassphraseRequiredReasonToString( |
| 25 PassphraseRequiredReason reason) { |
| 26 switch (reason) { |
| 27 case REASON_PASSPHRASE_NOT_REQUIRED: |
| 28 return "REASON_PASSPHRASE_NOT_REQUIRED"; |
| 29 case REASON_ENCRYPTION: |
| 30 return "REASON_ENCRYPTION"; |
| 31 case REASON_DECRYPTION: |
| 32 return "REASON_DECRYPTION"; |
| 33 default: |
| 34 NOTREACHED(); |
| 35 return "INVALID_REASON"; |
| 36 } |
| 37 } |
| 38 |
| 39 } // namespace syncer |
OLD | NEW |