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

Side by Side Diff: remoting/protocol/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 | « remoting/host/event_executor_mac.cc ('k') | remoting/protocol/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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef REMOTING_CLIENT_MOUSE_INPUT_FILTER_H_ 5 #ifndef REMOTING_PROTOCOL_MOUSE_INPUT_FILTER_H_
6 #define REMOTING_CLIENT_MOUSE_INPUT_FILTER_H_ 6 #define REMOTING_PROTOCOL_MOUSE_INPUT_FILTER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "remoting/protocol/input_filter.h"
10 #include "remoting/protocol/input_stub.h" 11 #include "remoting/protocol/input_stub.h"
11 #include "third_party/skia/include/core/SkTypes.h" 12 #include "third_party/skia/include/core/SkTypes.h"
12 #include "third_party/skia/include/core/SkSize.h" 13 #include "third_party/skia/include/core/SkSize.h"
13 14
14 namespace remoting { 15 namespace remoting {
16 namespace protocol {
15 17
16 // Filtering InputStub implementation which scales mouse events based on the 18 // Filtering InputStub implementation which scales mouse events based on the
17 // supplied input and output dimensions, and clamps their coordinates to the 19 // supplied input and output dimensions, and clamps their coordinates to the
18 // output dimensions, before passing events on to |input_stub|. 20 // output dimensions, before passing events on to |input_stub|.
19 class MouseInputFilter : public protocol::InputStub { 21 class MouseInputFilter : public InputFilter {
20 public: 22 public:
21 explicit MouseInputFilter(protocol::InputStub* input_stub); 23 explicit MouseInputFilter(InputStub* input_stub);
22 virtual ~MouseInputFilter(); 24 virtual ~MouseInputFilter();
23 25
24 // Specify the input dimensions for mouse events. 26 // Specify the input dimensions for mouse events.
25 void set_input_size(const SkISize& size); 27 void set_input_size(const SkISize& size);
26 28
27 // Specify the output dimensions. 29 // Specify the output dimensions.
28 void set_output_size(const SkISize& size); 30 void set_output_size(const SkISize& size);
29 31
30 // InputStub interface. 32 // InputStub overrides.
31 virtual void InjectKeyEvent(const protocol::KeyEvent& event) OVERRIDE;
32 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE; 33 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE;
33 34
34 private: 35 private:
35 protocol::InputStub* input_stub_;
36
37 SkISize input_max_; 36 SkISize input_max_;
38 SkISize output_max_; 37 SkISize output_max_;
39 38
40 DISALLOW_COPY_AND_ASSIGN(MouseInputFilter); 39 DISALLOW_COPY_AND_ASSIGN(MouseInputFilter);
41 }; 40 };
42 41
42 } // namespace protocol
43 } // namespace remoting 43 } // namespace remoting
44 44
45 #endif // REMOTING_CLIENT_MOUSE_INPUT_FILTER_H_ 45 #endif // REMOTING_PROTOCOL_MOUSE_INPUT_FILTER_H_
OLDNEW
« no previous file with comments | « remoting/host/event_executor_mac.cc ('k') | remoting/protocol/mouse_input_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698