OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SYNC_DRIVER_FAKE_DATA_TYPE_CONTROLLER_H__ | 5 #ifndef COMPONENTS_SYNC_DRIVER_FAKE_DATA_TYPE_CONTROLLER_H__ |
6 #define COMPONENTS_SYNC_DRIVER_FAKE_DATA_TYPE_CONTROLLER_H__ | 6 #define COMPONENTS_SYNC_DRIVER_FAKE_DATA_TYPE_CONTROLLER_H__ |
7 | 7 |
8 #include "components/sync_driver/data_type_controller.h" | 8 #include "components/sync_driver/data_type_controller.h" |
9 #include "components/sync_driver/data_type_manager.h" | 9 #include "components/sync_driver/data_type_manager.h" |
10 | 10 |
11 namespace browser_sync { | 11 namespace sync_driver { |
| 12 |
12 // Fake DataTypeController implementation that simulates the state | 13 // Fake DataTypeController implementation that simulates the state |
13 // machine of a typical asynchronous data type. | 14 // machine of a typical asynchronous data type. |
14 // | 15 // |
15 // TODO(akalin): Consider using subclasses of | 16 // TODO(akalin): Consider using subclasses of |
16 // {Frontend,NonFrontend,NewNonFrontend}DataTypeController instead, so | 17 // {Frontend,NonFrontend,NewNonFrontend}DataTypeController instead, so |
17 // that we don't have to update this class if we change the expected | 18 // that we don't have to update this class if we change the expected |
18 // behavior of controllers. (It would be easier of the above classes | 19 // behavior of controllers. (It would be easier of the above classes |
19 // used delegation instead of subclassing for per-data-type | 20 // used delegation instead of subclassing for per-data-type |
20 // functionality.) | 21 // functionality.) |
21 class FakeDataTypeController : public DataTypeController { | 22 class FakeDataTypeController : public DataTypeController { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 59 |
59 private: | 60 private: |
60 DataTypeController::State state_; | 61 DataTypeController::State state_; |
61 bool model_load_delayed_; | 62 bool model_load_delayed_; |
62 syncer::ModelType type_; | 63 syncer::ModelType type_; |
63 StartCallback last_start_callback_; | 64 StartCallback last_start_callback_; |
64 ModelLoadCallback model_load_callback_; | 65 ModelLoadCallback model_load_callback_; |
65 syncer::SyncError load_error_; | 66 syncer::SyncError load_error_; |
66 }; | 67 }; |
67 | 68 |
68 } // namespace browser_sync | 69 } // namespace sync_driver |
| 70 |
69 #endif // COMPONENTS_SYNC_DRIVER_FAKE_DATA_TYPE_CONTROLLER_H__ | 71 #endif // COMPONENTS_SYNC_DRIVER_FAKE_DATA_TYPE_CONTROLLER_H__ |
OLD | NEW |