| 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 ThemeModelAssociator(ProfileSyncService* sync_service); |
| 23 UnrecoverableErrorHandler* error_handler); | |
| 24 virtual ~ThemeModelAssociator(); | 23 virtual ~ThemeModelAssociator(); |
| 25 | 24 |
| 26 // Used by profile_sync_test_util.h. | 25 // Used by profile_sync_test_util.h. |
| 27 static syncable::ModelType model_type() { return syncable::THEMES; } | 26 static syncable::ModelType model_type() { return syncable::THEMES; } |
| 28 | 27 |
| 29 // AssociatorInterface implementation. | 28 // AssociatorInterface implementation. |
| 30 virtual bool AssociateModels(); | 29 virtual bool AssociateModels(); |
| 31 virtual bool DisassociateModels(); | 30 virtual bool DisassociateModels(); |
| 32 virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes); | 31 virtual bool SyncModelHasUserCreatedNodes(bool* has_nodes); |
| 33 virtual bool ChromeModelHasUserCreatedNodes(bool* has_nodes); | 32 virtual bool ChromeModelHasUserCreatedNodes(bool* has_nodes); |
| 34 virtual void AbortAssociation() { | 33 virtual void AbortAssociation() { |
| 35 // No implementation needed, this associator runs on the main | 34 // No implementation needed, this associator runs on the main |
| 36 // thread. | 35 // thread. |
| 37 } | 36 } |
| 38 | 37 |
| 39 private: | 38 private: |
| 40 ProfileSyncService* sync_service_; | 39 ProfileSyncService* sync_service_; |
| 41 UnrecoverableErrorHandler* error_handler_; | |
| 42 | 40 |
| 43 DISALLOW_COPY_AND_ASSIGN(ThemeModelAssociator); | 41 DISALLOW_COPY_AND_ASSIGN(ThemeModelAssociator); |
| 44 }; | 42 }; |
| 45 | 43 |
| 46 } // namespace browser_sync | 44 } // namespace browser_sync |
| 47 | 45 |
| 48 #endif // CHROME_BROWSER_SYNC_GLUE_THEME_MODEL_ASSOCIATOR_H_ | 46 #endif // CHROME_BROWSER_SYNC_GLUE_THEME_MODEL_ASSOCIATOR_H_ |
| OLD | NEW |