Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(491)

Side by Side Diff: chrome/browser/sync/js/js_controller.h

Issue 9699057: [Sync] Move 'sync' target to sync/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Tim's comments Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/sync/js/js_backend.h ('k') | chrome/browser/sync/js/js_event_details.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_BROWSER_SYNC_JS_JS_CONTROLLER_H_
6 #define CHROME_BROWSER_SYNC_JS_JS_CONTROLLER_H_
7 #pragma once
8
9 // See README.js for design comments.
10
11 #include <string>
12
13 namespace browser_sync {
14
15 class JsArgList;
16 class JsEventHandler;
17 class JsReplyHandler;
18 template <typename T> class WeakHandle;
19
20 // An interface for objects that JsEventHandlers directly interact
21 // with. JsEventHandlers can add themselves to receive events and
22 // also send messages which will eventually reach the backend.
23 class JsController {
24 public:
25 // Adds an event handler which will start receiving JS events (not
26 // immediately, so this can be called in the handler's constructor).
27 // Multiple event handlers are supported, but each event handler
28 // must be added at most once.
29 //
30 // Ideally, we'd take WeakPtrs, but we need the raw pointer values
31 // to be able to look them up for removal.
32 virtual void AddJsEventHandler(JsEventHandler* event_handler) = 0;
33
34 // Removes the given event handler if it has been added. It will
35 // immediately stop receiving any JS events.
36 virtual void RemoveJsEventHandler(JsEventHandler* event_handler) = 0;
37
38 // Processes a JS message. The reply (if any) will be sent to
39 // |reply_handler| if it is initialized.
40 virtual void ProcessJsMessage(
41 const std::string& name, const JsArgList& args,
42 const WeakHandle<JsReplyHandler>& reply_handler) = 0;
43
44 protected:
45 virtual ~JsController() {}
46 };
47
48 } // namespace browser_sync
49
50 #endif // CHROME_BROWSER_SYNC_JS_JS_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/js/js_backend.h ('k') | chrome/browser/sync/js/js_event_details.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698