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

Unified Diff: remoting/host/mouse_clamping_filter.cc

Issue 10829409: Add MouseClampingFilter and update ClientSession to use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. 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
« no previous file with comments | « remoting/host/mouse_clamping_filter.h ('k') | remoting/protocol/mouse_input_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/host/mouse_clamping_filter.cc
diff --git a/remoting/host/mouse_clamping_filter.cc b/remoting/host/mouse_clamping_filter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2d1a7ffc082baf2bb258851aabd62c8df95a6f96
--- /dev/null
+++ b/remoting/host/mouse_clamping_filter.cc
@@ -0,0 +1,27 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "remoting/host/mouse_clamping_filter.h"
+
+#include "remoting/host/video_frame_capturer.h"
+#include "remoting/proto/event.pb.h"
+
+namespace remoting {
+
+MouseClampingFilter::MouseClampingFilter(VideoFrameCapturer* capturer,
+ protocol::InputStub* input_stub)
+ : MouseInputFilter(input_stub), capturer_(capturer) {
+}
+
+MouseClampingFilter::~MouseClampingFilter() {
+}
+
+void MouseClampingFilter::InjectMouseEvent(const protocol::MouseEvent& event) {
+ // Ensure that the MouseInputFilter is clamping to the current dimensions.
+ set_output_size(capturer_->size_most_recent());
+ set_input_size(capturer_->size_most_recent());
+ MouseInputFilter::InjectMouseEvent(event);
+}
+
+} // namespace remoting
« no previous file with comments | « remoting/host/mouse_clamping_filter.h ('k') | remoting/protocol/mouse_input_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698