Chromium Code Reviews| 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..378b5c5c45a68af8468b309821da8a1ebb1054f2 |
| --- /dev/null |
| +++ b/remoting/host/mouse_clamping_filter.cc |
| @@ -0,0 +1,32 @@ |
| +// 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" |
| +#include "remoting/protocol/mouse_input_filter.h" |
| + |
| +namespace remoting { |
| + |
| +MouseClampingFilter::MouseClampingFilter( |
| + VideoFrameCapturer* capturer, |
| + protocol::MouseInputFilter* mouse_input_filter) |
| + : InputFilter(mouse_input_filter), |
| + capturer_(capturer), |
| + mouse_input_filter_(mouse_input_filter) { |
|
simonmorris
2012/08/20 20:59:45
Aliasing an object as both a member variable and a
|
| +} |
| + |
| +MouseClampingFilter::~MouseClampingFilter() { |
| +} |
| + |
| +void MouseClampingFilter::InjectMouseEvent(const protocol::MouseEvent& event) { |
| + // 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()); |
| + |
| + InputFilter::InjectMouseEvent(event); |
| +} |
| + |
| +} // namespace remoting |