1 // Copyright (c) 2011 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.
5 #ifndef CHROME_BROWSER_SYNC_JS_EVENT_ROUTER_H_
6 #define CHROME_BROWSER_SYNC_JS_EVENT_ROUTER_H_
9 // See README.js for design comments.
13 namespace browser_sync
{
19 // An interface for objects that don't directly handle Javascript
20 // events but can pass them to JsEventHandlers or route them to other
24 virtual void RouteJsEvent(
25 const std::string
& name
, const JsEventDetails
& details
) = 0;
27 // |target| is const because it shouldn't be used except by the
28 // router that directly knows about it (which can then safely cast
29 // away the constness).
30 virtual void RouteJsMessageReply(
31 const std::string
& name
, const JsArgList
& args
,
32 const JsEventHandler
* target
) = 0;
35 virtual ~JsEventRouter() {}
38 } // namespace browser_sync
40 #endif // CHROME_BROWSER_SYNC_JS_EVENT_ROUTER_H_