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
3 // found in the LICENSE file.
4 
5 #ifndef COMPONENTS_SYNC_JS_JS_BACKEND_H_
6 #define COMPONENTS_SYNC_JS_JS_BACKEND_H_
7 
8 // See README for design comments.
9 
10 #include <string>
11 
12 namespace syncer {
13 
14 class JsEventHandler;
15 template <typename T>
16 class WeakHandle;
17 
18 // Interface representing the backend of chrome://sync-internals.  A
19 // JsBackend can handle messages and can emit events to a
20 // JsEventHandler.
21 class JsBackend {
22  public:
23   // Starts emitting events to the given handler, if initialized.
24   virtual void SetJsEventHandler(
25       const WeakHandle<JsEventHandler>& event_handler) = 0;
26 
27  protected:
~JsBackend()28   virtual ~JsBackend() {}
29 };
30 
31 }  // namespace syncer
32 
33 #endif  // COMPONENTS_SYNC_JS_JS_BACKEND_H_
34