Upstream version 5.34.104.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 std::string name() const OVERRIDE;
31   virtual State state() const OVERRIDE;
32
33   // DataTypeErrorHandler interface.
34   virtual void OnSingleDatatypeUnrecoverableError(
35       const tracked_objects::Location& from_here,
36       const std::string& message) 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 browser_sync
55
56 #endif  // COMPONENTS_SYNC_DRIVER_PROXY_DATA_TYPE_CONTROLLER_H__