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