summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorgarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-25 17:23:53 +0000
committergarykac@chromium.org <garykac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-25 17:23:53 +0000
commit08f44aa3b9de47dec72f931ff36db9c1d067aeed (patch)
treead2401d48b4549e87650ced64e09877f42f37f79 /remoting
parent779ff2a938b102350bbbc709b7223860b2b3b04d (diff)
downloadchromium_src-08f44aa3b9de47dec72f931ff36db9c1d067aeed.zip
chromium_src-08f44aa3b9de47dec72f931ff36db9c1d067aeed.tar.gz
chromium_src-08f44aa3b9de47dec72f931ff36db9c1d067aeed.tar.bz2
Pass ClientContext, HostConnection and ChromotingView into the input handler since they will be needed to properly handle user input and sent it to the host.
BUG=none TEST=remoting unittests Review URL: http://codereview.chromium.org/3148029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57341 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-rw-r--r--remoting/client/input_handler.h15
-rw-r--r--remoting/client/plugin/chromoting_instance.cc3
-rw-r--r--remoting/client/plugin/pepper_input_handler.cc5
-rw-r--r--remoting/client/plugin/pepper_input_handler.h4
-rw-r--r--remoting/client/x11_client.cc2
-rw-r--r--remoting/client/x11_input_handler.cc5
-rw-r--r--remoting/client/x11_input_handler.h7
7 files changed, 30 insertions, 11 deletions
diff --git a/remoting/client/input_handler.h b/remoting/client/input_handler.h
index fad3718..9cbdd7d 100644
--- a/remoting/client/input_handler.h
+++ b/remoting/client/input_handler.h
@@ -10,14 +10,27 @@
namespace remoting {
+class ClientContext;
+class ChromotingView;
+class HostConnection;
+
class InputHandler {
public:
- InputHandler() {}
+ InputHandler(ClientContext* context,
+ HostConnection* connection,
+ ChromotingView* view)
+ : context_(context),
+ connection_(connection),
+ view_(view) {}
virtual ~InputHandler() {}
virtual void Initialize() = 0;
protected:
+ ClientContext* context_;
+ HostConnection* connection_;
+ ChromotingView* view_;
+
DISALLOW_COPY_AND_ASSIGN(InputHandler);
};
diff --git a/remoting/client/plugin/chromoting_instance.cc b/remoting/client/plugin/chromoting_instance.cc
index 819eec9..6cbc510 100644
--- a/remoting/client/plugin/chromoting_instance.cc
+++ b/remoting/client/plugin/chromoting_instance.cc
@@ -68,7 +68,8 @@ bool ChromotingInstance::Init(uint32_t argc,
// Create the chromoting objects.
host_connection_.reset(new JingleHostConnection(&context_));
view_.reset(new PepperView(this));
- input_handler_.reset(new PepperInputHandler());
+ input_handler_.reset(new PepperInputHandler(&context_, host_connection_.get(),
+ view_.get()));
// Default to a medium grey.
view_->SetSolidFill(0xFFCDCDCD);
diff --git a/remoting/client/plugin/pepper_input_handler.cc b/remoting/client/plugin/pepper_input_handler.cc
index 53cced3..96e8149 100644
--- a/remoting/client/plugin/pepper_input_handler.cc
+++ b/remoting/client/plugin/pepper_input_handler.cc
@@ -6,7 +6,10 @@
namespace remoting {
-PepperInputHandler::PepperInputHandler() {
+PepperInputHandler::PepperInputHandler(ClientContext* context,
+ HostConnection* connection,
+ ChromotingView* view)
+ : InputHandler(context, connection, view) {
}
PepperInputHandler::~PepperInputHandler() {
diff --git a/remoting/client/plugin/pepper_input_handler.h b/remoting/client/plugin/pepper_input_handler.h
index 59399e9..4db2f87 100644
--- a/remoting/client/plugin/pepper_input_handler.h
+++ b/remoting/client/plugin/pepper_input_handler.h
@@ -11,7 +11,9 @@ namespace remoting {
class PepperInputHandler : public InputHandler {
public:
- PepperInputHandler();
+ PepperInputHandler(ClientContext* context,
+ HostConnection* connection,
+ ChromotingView* view);
virtual ~PepperInputHandler();
void Initialize();
diff --git a/remoting/client/x11_client.cc b/remoting/client/x11_client.cc
index 10d459c..fd3f410 100644
--- a/remoting/client/x11_client.cc
+++ b/remoting/client/x11_client.cc
@@ -31,7 +31,7 @@ int main(int argc, char** argv) {
remoting::ClientContext context;
remoting::JingleHostConnection connection(&context);
remoting::X11View view;
- remoting::X11InputHandler input_handler(&context, &view);
+ remoting::X11InputHandler input_handler(&context, &connection, &view);
remoting::ChromotingClient client(config, &context, &connection, &view,
&input_handler, NewRunnableFunction(&ClientQuit, &ui_loop));
diff --git a/remoting/client/x11_input_handler.cc b/remoting/client/x11_input_handler.cc
index 887862c..900b492 100644
--- a/remoting/client/x11_input_handler.cc
+++ b/remoting/client/x11_input_handler.cc
@@ -6,6 +6,7 @@
#include "base/message_loop.h"
#include "remoting/client/client_context.h"
+#include "remoting/client/host_connection.h"
#include "remoting/client/x11_view.h"
#include "remoting/jingle_glue/jingle_thread.h"
@@ -16,9 +17,9 @@
namespace remoting {
X11InputHandler::X11InputHandler(ClientContext* context,
+ HostConnection* connection,
ChromotingView* view)
- : context_(context),
- view_(view) {
+ : InputHandler(context, connection, view) {
}
X11InputHandler::~X11InputHandler() {
diff --git a/remoting/client/x11_input_handler.h b/remoting/client/x11_input_handler.h
index f4b4471..5d63ca3 100644
--- a/remoting/client/x11_input_handler.h
+++ b/remoting/client/x11_input_handler.h
@@ -14,7 +14,9 @@ class ChromotingView;
class X11InputHandler : public InputHandler {
public:
- X11InputHandler(ClientContext* context, ChromotingView* view);
+ X11InputHandler(ClientContext* context,
+ HostConnection* connection,
+ ChromotingView* view);
virtual ~X11InputHandler();
void Initialize();
@@ -25,9 +27,6 @@ class X11InputHandler : public InputHandler {
void ScheduleX11EventHandler();
- ClientContext* context_;
- ChromotingView* view_;
-
DISALLOW_COPY_AND_ASSIGN(X11InputHandler);
};