From 4d37c874d917cc370e188cfdef05bb629388421a Mon Sep 17 00:00:00 2001 From: "garykac@google.com" Date: Tue, 20 Jul 2010 00:34:57 +0000 Subject: Refactor the client code for the X11 version. Make ChromotingViews responsible for initializing themselves. Move all x11-related code into X11View. Create InputCapturer class manage client input capture. BUG=none TEST=ran Win host + X11 client Review URL: http://codereview.chromium.org/2861047 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52973 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/client/chromoting_client.h | 42 +++++++++++++++++++++++-------------- 1 file changed, 26 insertions(+), 16 deletions(-) (limited to 'remoting/client/chromoting_client.h') diff --git a/remoting/client/chromoting_client.h b/remoting/client/chromoting_client.h index 50cc0dc..331c805 100644 --- a/remoting/client/chromoting_client.h +++ b/remoting/client/chromoting_client.h @@ -15,14 +15,25 @@ class MessageLoop; namespace remoting { class ChromotingView; +class ClientConfig; +class ClientContext; +class InputHandler; class ChromotingClient : public HostConnection::HostEventCallback { public: - ChromotingClient(MessageLoop* message_loop, + // Objects passed in are not owned by this class. + ChromotingClient(ClientConfig* config, + ClientContext* context, HostConnection* connection, - ChromotingView* view); + ChromotingView* view, + InputHandler* input_handler, + CancelableTask* client_done); virtual ~ChromotingClient(); + void Start(); + void Stop(); + void ClientDone(); + // Signals that the associated view may need updating. virtual void Repaint(); @@ -53,25 +64,24 @@ class ChromotingClient : public HostConnection::HostEventCallback { // Convenience method for modifying the state on this object's message loop. void SetState(State s); - // TODO(ajwong): Do all of these methods need to run on the client's thread? - void DoSetState(State s); - void DoRepaint(); - void DoSetViewport(int x, int y, int width, int height); - // Handles for chromotocol messages. - void DoInitClient(HostMessage* msg); - void DoBeginUpdate(HostMessage* msg); - void DoHandleUpdate(HostMessage* msg); - void DoEndUpdate(HostMessage* msg); + void InitClient(HostMessage* msg); + void BeginUpdate(HostMessage* msg); + void HandleUpdate(HostMessage* msg); + void EndUpdate(HostMessage* msg); + + // The following are not owned by this class. + ClientConfig* config_; + ClientContext* context_; + HostConnection* connection_; + ChromotingView* view_; + InputHandler* input_handler_; - MessageLoop* message_loop_; + // If non-NULL, this is called when the client is done. + CancelableTask* client_done_; State state_; - // Connection to views and hosts. Not owned. - HostConnection* host_connection_; - ChromotingView* view_; - DISALLOW_COPY_AND_ASSIGN(ChromotingClient); }; -- cgit v1.1