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