1// Copyright 2014 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 COMPONENTS_SYNC_DRIVER_PROXY_DATA_TYPE_CONTROLLER_H__
6#define COMPONENTS_SYNC_DRIVER_PROXY_DATA_TYPE_CONTROLLER_H__
7
8#include "base/basictypes.h"
9#include "base/compiler_specific.h"
10#include "components/sync_driver/data_type_controller.h"
11
12namespace sync_driver {
13
14// Implementation for proxy datatypes. These are datatype that have no
15// representation in sync, and therefore no change processor or syncable
16// service.
17class ProxyDataTypeController : public DataTypeController {
18 public:
19  explicit ProxyDataTypeController(
20       scoped_refptr<base::MessageLoopProxy> ui_thread,
21       syncer::ModelType type);
22
23  // DataTypeController interface.
24  virtual void LoadModels(
25      const ModelLoadCallback& model_load_callback) OVERRIDE;
26  virtual void StartAssociating(const StartCallback& start_callback) OVERRIDE;
27  virtual void Stop() OVERRIDE;
28  virtual syncer::ModelType type() const OVERRIDE;
29  virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE;
30  virtual ChangeProcessor* GetChangeProcessor() const OVERRIDE;
31  virtual std::string name() const OVERRIDE;
32  virtual State state() const OVERRIDE;
33
34  // DataTypeErrorHandler interface.
35  virtual void OnSingleDataTypeUnrecoverableError(
36      const syncer::SyncError& error) OVERRIDE;
37
38 protected:
39  // DataTypeController is RefCounted.
40  virtual ~ProxyDataTypeController();
41
42  // DataTypeController interface.
43  virtual void OnModelLoaded() OVERRIDE;
44
45 private:
46  State state_;
47
48  // The actual type for this controller.
49  syncer::ModelType type_;
50
51  DISALLOW_COPY_AND_ASSIGN(ProxyDataTypeController);
52};
53
54}  // namespace sync_driver
55
56#endif  // COMPONENTS_SYNC_DRIVER_PROXY_DATA_TYPE_CONTROLLER_H__
57