Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 #ifndef SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_ | 4 #ifndef SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_ |
| 5 #define SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_ | 5 #define SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_ |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "sync/base/sync_export.h" | 10 #include "sync/base/sync_export.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 // Indicates the datatypes have been migrated and the client should resync | 35 // Indicates the datatypes have been migrated and the client should resync |
| 36 // them to get the latest progress markers. | 36 // them to get the latest progress markers. |
| 37 MIGRATION_DONE, | 37 MIGRATION_DONE, |
| 38 | 38 |
| 39 // Invalid Credential. | 39 // Invalid Credential. |
| 40 INVALID_CREDENTIAL, | 40 INVALID_CREDENTIAL, |
| 41 | 41 |
| 42 // An administrator disabled sync for this domain. | 42 // An administrator disabled sync for this domain. |
| 43 DISABLED_BY_ADMIN, | 43 DISABLED_BY_ADMIN, |
| 44 | 44 |
| 45 // User asked to stop syncing this device and roll back local data. | |
|
Nicolas Zea
2014/04/18 18:06:50
Here too
haitaol1
2014/04/18 20:01:31
Done.
| |
| 46 USER_ROLLBACK, | |
| 47 | |
| 45 // The default value. | 48 // The default value. |
| 46 UNKNOWN_ERROR | 49 UNKNOWN_ERROR |
| 47 }; | 50 }; |
| 48 | 51 |
| 49 enum ClientAction { | 52 enum ClientAction { |
| 50 // Upgrade the client to latest version. | 53 // Upgrade the client to latest version. |
| 51 UPGRADE_CLIENT, | 54 UPGRADE_CLIENT, |
| 52 | 55 |
| 53 // Clear user data and setup sync again. | 56 // Clear user data and setup sync again. |
| 54 CLEAR_USER_DATA_AND_RESYNC, | 57 CLEAR_USER_DATA_AND_RESYNC, |
| 55 | 58 |
| 56 // Set the bit on the account to enable sync. | 59 // Set the bit on the account to enable sync. |
| 57 ENABLE_SYNC_ON_ACCOUNT, | 60 ENABLE_SYNC_ON_ACCOUNT, |
| 58 | 61 |
| 59 // Stop sync and restart sync. | 62 // Stop sync and restart sync. |
| 60 STOP_AND_RESTART_SYNC, | 63 STOP_AND_RESTART_SYNC, |
| 61 | 64 |
| 62 // Wipe this client of any sync data. | 65 // Wipe this client of any sync data. |
| 63 DISABLE_SYNC_ON_CLIENT, | 66 DISABLE_SYNC_ON_CLIENT, |
| 64 | 67 |
| 65 // Account is disabled by admin. Stop sync, clear prefs and show message on | 68 // Account is disabled by admin. Stop sync, clear prefs and show message on |
| 66 // settings page that account is disabled. | 69 // settings page that account is disabled. |
| 67 STOP_SYNC_FOR_DISABLED_ACCOUNT, | 70 STOP_SYNC_FOR_DISABLED_ACCOUNT, |
| 68 | 71 |
| 72 // Disable sync and roll back local model to pre-sync state. | |
| 73 DISABLE_SYNC_AND_ROLLBACK, | |
| 74 | |
| 69 // The default. No action. | 75 // The default. No action. |
| 70 UNKNOWN_ACTION | 76 UNKNOWN_ACTION |
| 71 }; | 77 }; |
| 72 | 78 |
| 73 struct SYNC_EXPORT SyncProtocolError { | 79 struct SYNC_EXPORT SyncProtocolError { |
| 74 SyncProtocolErrorType error_type; | 80 SyncProtocolErrorType error_type; |
| 75 std::string error_description; | 81 std::string error_description; |
| 76 std::string url; | 82 std::string url; |
| 77 ClientAction action; | 83 ClientAction action; |
| 78 ModelTypeSet error_data_types; | 84 ModelTypeSet error_data_types; |
| 79 SyncProtocolError(); | 85 SyncProtocolError(); |
| 80 ~SyncProtocolError(); | 86 ~SyncProtocolError(); |
| 81 base::DictionaryValue* ToValue() const; | 87 base::DictionaryValue* ToValue() const; |
| 82 }; | 88 }; |
| 83 | 89 |
| 84 SYNC_EXPORT const char* GetSyncErrorTypeString(SyncProtocolErrorType type); | 90 SYNC_EXPORT const char* GetSyncErrorTypeString(SyncProtocolErrorType type); |
| 85 SYNC_EXPORT const char* GetClientActionString(ClientAction action); | 91 SYNC_EXPORT const char* GetClientActionString(ClientAction action); |
| 86 } // namespace syncer | 92 } // namespace syncer |
| 87 #endif // SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_ | 93 #endif // SYNC_PROTOCOL_SYNC_PROTOCOL_ERROR_H_ |
| 88 | 94 |
| OLD | NEW |