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

Unified Diff: remoting/host/client_session.cc

Issue 10829409: Add MouseClampingFilter and update ClientSession to use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: remoting/host/client_session.cc
diff --git a/remoting/host/client_session.cc b/remoting/host/client_session.cc
index 540277ecc6d041fa2262597be002c0ee79d5833c..598ebbba9771842b7f9ee2c488db93b4feb1885f 100644
--- a/remoting/host/client_session.cc
+++ b/remoting/host/client_session.cc
@@ -30,7 +30,7 @@ ClientSession::ClientSession(
host_input_stub_(host_input_stub),
input_tracker_(host_input_stub_),
remote_input_filter_(&input_tracker_),
- mouse_input_filter_(&remote_input_filter_),
+ mouse_clamping_filter_(capturer, &remote_input_filter_),
client_clipboard_factory_(clipboard_echo_filter_.client_filter()),
capturer_(capturer),
max_duration_(max_duration) {
@@ -41,28 +41,13 @@ ClientSession::ClientSession(
// later and set them only when connection is authenticated.
connection_->set_clipboard_stub(&auth_clipboard_filter_);
connection_->set_host_stub(this);
- connection_->set_input_stub(this);
+ connection_->set_input_stub(&auth_input_filter_);
clipboard_echo_filter_.set_host_stub(host_clipboard_stub_);
}
ClientSession::~ClientSession() {
}
-void ClientSession::InjectKeyEvent(const protocol::KeyEvent& event) {
- DCHECK(CalledOnValidThread());
- auth_input_filter_.InjectKeyEvent(event);
-}
-
-void ClientSession::InjectMouseEvent(const protocol::MouseEvent& event) {
- DCHECK(CalledOnValidThread());
-
- // Ensure that the MouseInputFilter is clamping to the current dimensions.
- mouse_input_filter_.set_output_size(capturer_->size_most_recent());
- mouse_input_filter_.set_input_size(capturer_->size_most_recent());
-
- auth_input_filter_.InjectMouseEvent(event);
-}
-
void ClientSession::NotifyClientDimensions(
const protocol::ClientDimensions& dimensions) {
// TODO(wez): Use the dimensions, e.g. to resize the host desktop to match.
@@ -166,7 +151,7 @@ void ClientSession::SetDisableInputs(bool disable_inputs) {
disable_clipboard_filter_.set_clipboard_stub(NULL);
input_tracker_.ReleaseAll();
} else {
- disable_input_filter_.set_input_stub(&mouse_input_filter_);
+ disable_input_filter_.set_input_stub(&mouse_clamping_filter_);
disable_clipboard_filter_.set_clipboard_stub(
clipboard_echo_filter_.host_filter());
}

Powered by Google App Engine
This is Rietveld 408576698