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_GLUE_THEME_MODEL_ASSOCIATOR_H_ | 5 #ifndef CHROME_BROWSER_SYNC_GLUE_THEME_MODEL_ASSOCIATOR_H_ |
6 #define CHROME_BROWSER_SYNC_GLUE_THEME_MODEL_ASSOCIATOR_H_ | 6 #define CHROME_BROWSER_SYNC_GLUE_THEME_MODEL_ASSOCIATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "chrome/browser/sync/glue/data_type_error_handler.h" |
11 #include "chrome/browser/sync/glue/model_associator.h" | 12 #include "chrome/browser/sync/glue/model_associator.h" |
12 #include "sync/syncable/model_type.h" | 13 #include "sync/syncable/model_type.h" |
13 | 14 |
14 class ProfileSyncService; | 15 class ProfileSyncService; |
15 | 16 |
16 namespace browser_sync { | 17 namespace browser_sync { |
17 | 18 |
18 // Contains all logic for associating the Chrome themes model and the | 19 // Contains all logic for associating the Chrome themes model and the |
19 // sync themes model. | 20 // sync themes model. |
20 class ThemeModelAssociator : public AssociatorInterface { | 21 class ThemeModelAssociator : public AssociatorInterface { |
21 public: | 22 public: |
22 explicit ThemeModelAssociator(ProfileSyncService* sync_service); | 23 ThemeModelAssociator(ProfileSyncService* sync_service, |
| 24 DataTypeErrorHandler* error_handler); |
23 virtual ~ThemeModelAssociator(); | 25 virtual ~ThemeModelAssociator(); |
24 | 26 |
25 // Used by profile_sync_test_util.h. | 27 // Used by profile_sync_test_util.h. |
26 static syncable::ModelType model_type() { return syncable::THEMES; } | 28 static syncable::ModelType model_type() { return syncable::THEMES; } |
27 | 29 |
28 // AssociatorInterface implementation. | 30 // AssociatorInterface implementation. |
29 virtual bool AssociateModels(SyncError* error) OVERRIDE; | 31 virtual SyncError AssociateModels() OVERRIDE; |
30 virtual bool DisassociateModels(SyncError* error) OVERRIDE; | 32 virtual SyncError DisassociateModels() OVERRIDE; |
31 virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes) OVERRIDE; | 33 virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes) OVERRIDE; |
32 virtual void AbortAssociation() OVERRIDE { | 34 virtual void AbortAssociation() OVERRIDE { |
33 // No implementation needed, this associator runs on the main | 35 // No implementation needed, this associator runs on the main |
34 // thread. | 36 // thread. |
35 } | 37 } |
36 virtual bool CryptoReadyIfNecessary() OVERRIDE; | 38 virtual bool CryptoReadyIfNecessary() OVERRIDE; |
37 | 39 |
38 private: | 40 private: |
39 ProfileSyncService* sync_service_; | 41 ProfileSyncService* sync_service_; |
| 42 DataTypeErrorHandler* error_handler_; |
40 | 43 |
41 DISALLOW_COPY_AND_ASSIGN(ThemeModelAssociator); | 44 DISALLOW_COPY_AND_ASSIGN(ThemeModelAssociator); |
42 }; | 45 }; |
43 | 46 |
44 } // namespace browser_sync | 47 } // namespace browser_sync |
45 | 48 |
46 #endif // CHROME_BROWSER_SYNC_GLUE_THEME_MODEL_ASSOCIATOR_H_ | 49 #endif // CHROME_BROWSER_SYNC_GLUE_THEME_MODEL_ASSOCIATOR_H_ |
OLD | NEW |