Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / components / sync_driver / proxy_data_type_controller.h
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
12 namespace browser_sync {
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.
17 class 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 tracked_objects::Location& from_here,
37       const std::string& message) OVERRIDE;
38
39  protected:
40   // DataTypeController is RefCounted.
41   virtual ~ProxyDataTypeController();
42
43   // DataTypeController interface.
44   virtual void OnModelLoaded() OVERRIDE;
45
46  private:
47   State state_;
48
49   // The actual type for this controller.
50   syncer::ModelType type_;
51
52   DISALLOW_COPY_AND_ASSIGN(ProxyDataTypeController);
53 };
54
55 }  // namespace browser_sync
56
57 #endif  // COMPONENTS_SYNC_DRIVER_PROXY_DATA_TYPE_CONTROLLER_H__