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

Side by Side Diff: remoting/client/mouse_input_filter.h

Issue 10255007: Clamp events before they are sent to EventExecutors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix typo. Created 8 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | remoting/client/mouse_input_filter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef REMOTING_CLIENT_MOUSE_INPUT_FILTER_H_
6 #define REMOTING_CLIENT_MOUSE_INPUT_FILTER_H_
7
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "remoting/protocol/input_stub.h"
11 #include "third_party/skia/include/core/SkTypes.h"
12 #include "third_party/skia/include/core/SkSize.h"
13
14 namespace remoting {
15
16 // Filtering InputStub implementation which scales mouse events based on the
17 // supplied input and output dimensions, and clamps their coordinates to the
18 // output dimensions, before passing events on to |input_stub|.
19 class MouseInputFilter : public protocol::InputStub {
20 public:
21 explicit MouseInputFilter(protocol::InputStub* input_stub);
22 virtual ~MouseInputFilter();
23
24 // Specify the input dimensions for mouse events.
25 void set_input_size(const SkISize& size);
26
27 // Specify the output dimensions.
28 void set_output_size(const SkISize& size);
29
30 // InputStub interface.
31 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE;
32 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE;
33
34 private:
35 protocol::InputStub* input_stub_;
36
37 SkISize input_max_;
38 SkISize output_max_;
39
40 DISALLOW_COPY_AND_ASSIGN(MouseInputFilter);
41 };
42
43 } // namespace remoting
44
45 #endif // REMOTING_CLIENT_MOUSE_INPUT_FILTER_H_
OLDNEW
« no previous file with comments | « no previous file | remoting/client/mouse_input_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698