1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef REMOTING_HOST_MOUSE_CLAMPING_FILTER_H_
6 #define REMOTING_HOST_MOUSE_CLAMPING_FILTER_H_
8 #include "base/compiler_specific.h"
9 #include "remoting/protocol/mouse_input_filter.h"
10 #include "remoting/protocol/video_stub.h"
14 // Filtering VideoStub implementation which configures a MouseInputFilter to
15 // clamp mouse events to fall within the dimensions of the most-recently
16 // received video frame.
17 class MouseClampingFilter
: public protocol::VideoStub
{
19 explicit MouseClampingFilter(protocol::InputStub
* input_stub
);
20 virtual ~MouseClampingFilter();
22 protocol::InputStub
* input_filter() { return &input_filter_
; }
24 void set_video_stub(protocol::VideoStub
* video_stub
) {
25 video_stub_
= video_stub
;
28 // protocol::VideoStub implementation.
29 virtual void ProcessVideoPacket(scoped_ptr
<VideoPacket
> video_packet
,
30 const base::Closure
& done
) OVERRIDE
;
33 // Clamps mouse event coordinates to the video dimensions.
34 protocol::MouseInputFilter input_filter_
;
36 protocol::VideoStub
* video_stub_
;
38 DISALLOW_COPY_AND_ASSIGN(MouseClampingFilter
);
41 } // namespace remoting
43 #endif // REMOTING_HOST_MOUSE_CLAMPING_FILTER_H_