Upstream version 5.34.98.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / sync / glue / proxy_data_type_controller.h
1 // Copyright (c) 2013 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_PROXY_DATA_TYPE_CONTROLLER_H__
6 #define CHROME_BROWSER_SYNC_GLUE_PROXY_DATA_TYPE_CONTROLLER_H__
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "chrome/browser/sync/glue/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(syncer::ModelType type);
20
21   // DataTypeController interface.
22   virtual void LoadModels(
23       const ModelLoadCallback& model_load_callback) OVERRIDE;
24   virtual void StartAssociating(const StartCallback& start_callback) OVERRIDE;
25   virtual void Stop() OVERRIDE;
26   virtual syncer::ModelType type() const OVERRIDE;
27   virtual syncer::ModelSafeGroup model_safe_group() const OVERRIDE;
28   virtual std::string name() const OVERRIDE;
29   virtual State state() const OVERRIDE;
30
31   // DataTypeErrorHandler interface.
32   virtual void OnSingleDatatypeUnrecoverableError(
33       const tracked_objects::Location& from_here,
34       const std::string& message) OVERRIDE;
35
36  protected:
37   // DataTypeController is RefCounted.
38   virtual ~ProxyDataTypeController();
39
40   // DataTypeController interface.
41   virtual void OnModelLoaded() OVERRIDE;
42
43  private:
44   State state_;
45
46   // The actual type for this controller.
47   syncer::ModelType type_;
48
49   DISALLOW_COPY_AND_ASSIGN(ProxyDataTypeController);
50 };
51
52 }  // namespace browser_sync
53
54 #endif  // CHROME_BROWSER_SYNC_GLUE_PROXY_DATA_TYPE_CONTROLLER_H__