| OLD | NEW |
| 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_PROTOCOL_MOUSE_INPUT_FILTER_H_ | 5 #ifndef REMOTING_PROTOCOL_MOUSE_INPUT_FILTER_H_ |
| 6 #define REMOTING_PROTOCOL_MOUSE_INPUT_FILTER_H_ | 6 #define REMOTING_PROTOCOL_MOUSE_INPUT_FILTER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "remoting/protocol/input_filter.h" | 9 #include "remoting/protocol/input_filter.h" |
| 10 #include "third_party/skia/include/core/SkTypes.h" | 10 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" |
| 11 #include "third_party/skia/include/core/SkSize.h" | |
| 12 | 11 |
| 13 namespace remoting { | 12 namespace remoting { |
| 14 namespace protocol { | 13 namespace protocol { |
| 15 | 14 |
| 16 // Filtering InputStub implementation which scales mouse events based on the | 15 // Filtering InputStub implementation which scales mouse events based on the |
| 17 // supplied input and output dimensions, and clamps their coordinates to the | 16 // supplied input and output dimensions, and clamps their coordinates to the |
| 18 // output dimensions, before passing events on to |input_stub|. | 17 // output dimensions, before passing events on to |input_stub|. |
| 19 class MouseInputFilter : public InputFilter { | 18 class MouseInputFilter : public InputFilter { |
| 20 public: | 19 public: |
| 21 MouseInputFilter(); | 20 MouseInputFilter(); |
| 22 explicit MouseInputFilter(InputStub* input_stub); | 21 explicit MouseInputFilter(InputStub* input_stub); |
| 23 virtual ~MouseInputFilter(); | 22 virtual ~MouseInputFilter(); |
| 24 | 23 |
| 25 // Specify the input dimensions for mouse events. | 24 // Specify the input dimensions for mouse events. |
| 26 void set_input_size(const SkISize& size); | 25 void set_input_size(const webrtc::DesktopSize& size); |
| 27 | 26 |
| 28 // Specify the output dimensions. | 27 // Specify the output dimensions. |
| 29 void set_output_size(const SkISize& size); | 28 void set_output_size(const webrtc::DesktopSize& size); |
| 30 | 29 |
| 31 // InputStub overrides. | 30 // InputStub overrides. |
| 32 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE; | 31 virtual void InjectMouseEvent(const protocol::MouseEvent& event) OVERRIDE; |
| 33 | 32 |
| 34 private: | 33 private: |
| 35 SkISize input_max_; | 34 webrtc::DesktopSize input_max_; |
| 36 SkISize output_max_; | 35 webrtc::DesktopSize output_max_; |
| 37 | 36 |
| 38 DISALLOW_COPY_AND_ASSIGN(MouseInputFilter); | 37 DISALLOW_COPY_AND_ASSIGN(MouseInputFilter); |
| 39 }; | 38 }; |
| 40 | 39 |
| 41 } // namespace protocol | 40 } // namespace protocol |
| 42 } // namespace remoting | 41 } // namespace remoting |
| 43 | 42 |
| 44 #endif // REMOTING_PROTOCOL_MOUSE_INPUT_FILTER_H_ | 43 #endif // REMOTING_PROTOCOL_MOUSE_INPUT_FILTER_H_ |
| OLD | NEW |