diff options
author | garykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-20 00:34:57 +0000 |
---|---|---|
committer | garykac@google.com <garykac@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-20 00:34:57 +0000 |
commit | 4d37c874d917cc370e188cfdef05bb629388421a (patch) | |
tree | 08f68e3ef47406ae69209f489832fa8f1c76448e /remoting/client/chromoting_client.h | |
parent | 0af395eb3fa7d33473b4239a7b637fc6a7ce0e98 (diff) | |
download | chromium_src-4d37c874d917cc370e188cfdef05bb629388421a.zip chromium_src-4d37c874d917cc370e188cfdef05bb629388421a.tar.gz chromium_src-4d37c874d917cc370e188cfdef05bb629388421a.tar.bz2 |
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
Diffstat (limited to 'remoting/client/chromoting_client.h')
-rw-r--r-- | remoting/client/chromoting_client.h | 42 |
1 files changed, 26 insertions, 16 deletions
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); }; |