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