OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef COMPONENTS_SYNC_JS_JS_BACKEND_H_ | 5 #ifndef COMPONENTS_SYNC_JS_JS_BACKEND_H_ |
6 #define COMPONENTS_SYNC_JS_JS_BACKEND_H_ | 6 #define COMPONENTS_SYNC_JS_JS_BACKEND_H_ |
7 | 7 |
8 // See README.js for design comments. | 8 // See README.js for design comments. |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "components/sync/base/sync_export.h" | |
13 | |
14 namespace syncer { | 12 namespace syncer { |
15 | 13 |
16 class JsEventHandler; | 14 class JsEventHandler; |
17 template <typename T> | 15 template <typename T> |
18 class WeakHandle; | 16 class WeakHandle; |
19 | 17 |
20 // Interface representing the backend of chrome://sync-internals. A | 18 // Interface representing the backend of chrome://sync-internals. A |
21 // JsBackend can handle messages and can emit events to a | 19 // JsBackend can handle messages and can emit events to a |
22 // JsEventHandler. | 20 // JsEventHandler. |
23 class SYNC_EXPORT JsBackend { | 21 class JsBackend { |
24 public: | 22 public: |
25 // Starts emitting events to the given handler, if initialized. | 23 // Starts emitting events to the given handler, if initialized. |
26 virtual void SetJsEventHandler( | 24 virtual void SetJsEventHandler( |
27 const WeakHandle<JsEventHandler>& event_handler) = 0; | 25 const WeakHandle<JsEventHandler>& event_handler) = 0; |
28 | 26 |
29 protected: | 27 protected: |
30 virtual ~JsBackend() {} | 28 virtual ~JsBackend() {} |
31 }; | 29 }; |
32 | 30 |
33 } // namespace syncer | 31 } // namespace syncer |
34 | 32 |
35 #endif // COMPONENTS_SYNC_JS_JS_BACKEND_H_ | 33 #endif // COMPONENTS_SYNC_JS_JS_BACKEND_H_ |
OLD | NEW |