OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "chrome/browser/sync/glue/model_associator.h" | 9 #include "chrome/browser/sync/glue/model_associator.h" |
10 #include "chrome/browser/sync/syncable/model_type.h" | 10 #include "chrome/browser/sync/syncable/model_type.h" |
11 | 11 |
12 class ProfileSyncService; | 12 class ProfileSyncService; |
13 | 13 |
14 namespace browser_sync { | 14 namespace browser_sync { |
15 | 15 |
16 class UnrecoverableErrorHandler; | 16 class UnrecoverableErrorHandler; |
17 | 17 |
18 // Contains all logic for associating the Chrome themes model and the | 18 // Contains all logic for associating the Chrome themes model and the |
19 // sync themes model. | 19 // sync themes model. |
20 class ThemeModelAssociator : public AssociatorInterface { | 20 class ThemeModelAssociator : public AssociatorInterface { |
21 public: | 21 public: |
22 ThemeModelAssociator(ProfileSyncService* sync_service); | 22 explicit ThemeModelAssociator(ProfileSyncService* sync_service); |
23 virtual ~ThemeModelAssociator(); | 23 virtual ~ThemeModelAssociator(); |
24 | 24 |
25 // Used by profile_sync_test_util.h. | 25 // Used by profile_sync_test_util.h. |
26 static syncable::ModelType model_type() { return syncable::THEMES; } | 26 static syncable::ModelType model_type() { return syncable::THEMES; } |
27 | 27 |
28 // AssociatorInterface implementation. | 28 // AssociatorInterface implementation. |
29 virtual bool AssociateModels(); | 29 virtual bool AssociateModels(); |
30 virtual bool DisassociateModels(); | 30 virtual bool DisassociateModels(); |
31 virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes); | 31 virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes); |
32 virtual bool ChromeModelHasUserCreatedNodes(bool* has_nodes); | |
33 virtual void AbortAssociation() { | 32 virtual void AbortAssociation() { |
34 // No implementation needed, this associator runs on the main | 33 // No implementation needed, this associator runs on the main |
35 // thread. | 34 // thread. |
36 } | 35 } |
37 | 36 |
38 private: | 37 private: |
39 ProfileSyncService* sync_service_; | 38 ProfileSyncService* sync_service_; |
40 | 39 |
41 DISALLOW_COPY_AND_ASSIGN(ThemeModelAssociator); | 40 DISALLOW_COPY_AND_ASSIGN(ThemeModelAssociator); |
42 }; | 41 }; |
43 | 42 |
44 } // namespace browser_sync | 43 } // namespace browser_sync |
45 | 44 |
46 #endif // CHROME_BROWSER_SYNC_GLUE_THEME_MODEL_ASSOCIATOR_H_ | 45 #endif // CHROME_BROWSER_SYNC_GLUE_THEME_MODEL_ASSOCIATOR_H_ |
OLD | NEW |