| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 | 4 |
| 5 #ifndef CHROME_BROWSER_SYNC_FAILED_DATATYPES_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_SYNC_FAILED_DATATYPES_HANDLER_H_ |
| 6 #define CHROME_BROWSER_SYNC_FAILED_DATATYPES_HANDLER_H_ | 6 #define CHROME_BROWSER_SYNC_FAILED_DATATYPES_HANDLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // The datatype encountered a runtime error. | 22 // The datatype encountered a runtime error. |
| 23 RUNTIME | 23 RUNTIME |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 explicit FailedDatatypesHandler(ProfileSyncService* service); | 26 explicit FailedDatatypesHandler(ProfileSyncService* service); |
| 27 ~FailedDatatypesHandler(); | 27 ~FailedDatatypesHandler(); |
| 28 | 28 |
| 29 // Called with the result of sync configuration. The types with errors | 29 // Called with the result of sync configuration. The types with errors |
| 30 // are obtained from the |result|. | 30 // are obtained from the |result|. |
| 31 bool UpdateFailedDatatypes( | 31 bool UpdateFailedDatatypes( |
| 32 const std::list<SyncError>& errors, | 32 const std::list<csync::SyncError>& errors, |
| 33 FailureType failure_type); | 33 FailureType failure_type); |
| 34 | 34 |
| 35 // Called when the user has chosen a new set of datatypes to sync. We clear | 35 // Called when the user has chosen a new set of datatypes to sync. We clear |
| 36 // the current list of failed types and retry them once more. | 36 // the current list of failed types and retry them once more. |
| 37 void OnUserChoseDatatypes(); | 37 void OnUserChoseDatatypes(); |
| 38 | 38 |
| 39 // Returns the types that are failing. | 39 // Returns the types that are failing. |
| 40 syncable::ModelTypeSet GetFailedTypes() const; | 40 syncable::ModelTypeSet GetFailedTypes() const; |
| 41 | 41 |
| 42 // Returns if there are any failed types. | 42 // Returns if there are any failed types. |
| 43 bool AnyFailedDatatype() const; | 43 bool AnyFailedDatatype() const; |
| 44 | 44 |
| 45 // Gets the error string giving more info about each type that is failing. | 45 // Gets the error string giving more info about each type that is failing. |
| 46 std::string GetErrorString() const; | 46 std::string GetErrorString() const; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 // List of dataypes that failed at startup. | 49 // List of dataypes that failed at startup. |
| 50 std::list<SyncError> startup_errors_; | 50 std::list<csync::SyncError> startup_errors_; |
| 51 | 51 |
| 52 // List of datatypes that failed at runtime. | 52 // List of datatypes that failed at runtime. |
| 53 std::list<SyncError> runtime_errors_; | 53 std::list<csync::SyncError> runtime_errors_; |
| 54 | 54 |
| 55 ProfileSyncService* service_; | 55 ProfileSyncService* service_; |
| 56 | 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(FailedDatatypesHandler); | 57 DISALLOW_COPY_AND_ASSIGN(FailedDatatypesHandler); |
| 58 }; | 58 }; |
| 59 #endif // CHROME_BROWSER_SYNC_FAILED_DATATYPES_HANDLER_H_ | 59 #endif // CHROME_BROWSER_SYNC_FAILED_DATATYPES_HANDLER_H_ |
| OLD | NEW |