Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2015 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_PLUGIN_TOUCH_INPUT_SCALER_H_ | |
| 6 #define REMOTING_CLIENT_PLUGIN_TOUCH_INPUT_SCALER_H_ | |
| 7 | |
| 8 #include "remoting/protocol/input_filter.h" | |
| 9 #include "third_party/webrtc/modules/desktop_capture/desktop_geometry.h" | |
| 10 | |
| 11 namespace remoting { | |
| 12 | |
| 13 namespace protocol { | |
| 14 class TouchEvent; | |
| 15 } // namespace protocol | |
| 16 | |
| 17 // Scales the coordinates to host x,y value. The | |
|
Sergey Ulanov
2015/01/29 18:00:46
finish the comment
Rintaro Kuroiwa
2015/01/30 17:57:02
Done.
| |
| 18 // TODO(rkuroiwa): Consider renaming this to TouchInputScaler. | |
| 19 class TouchInputScaler : public protocol::InputFilter { | |
| 20 public: | |
| 21 TouchInputScaler() = default; | |
| 22 explicit TouchInputScaler(InputStub* input_stub); | |
| 23 ~TouchInputScaler() override; | |
| 24 | |
| 25 void set_input_size(const webrtc::DesktopSize& size) { | |
| 26 input_size_.set(size.width() - 1, size.height() - 1); | |
|
Sergey Ulanov
2015/01/29 18:00:46
why do you need -1 here?
Rintaro Kuroiwa
2015/01/30 17:57:02
Added a comment.
| |
| 27 } | |
| 28 | |
| 29 void set_output_size(const webrtc::DesktopSize& size) { | |
| 30 output_size_.set(size.width() - 1, size.height() - 1); | |
| 31 } | |
| 32 | |
| 33 // protocol::InputStub interface. | |
| 34 void InjectTouchEvent(const protocol::TouchEvent& event) override; | |
| 35 | |
| 36 private: | |
| 37 // Sizes for scaling the coordinates. | |
| 38 webrtc::DesktopSize input_size_; | |
| 39 webrtc::DesktopSize output_size_; | |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(TouchInputScaler); | |
| 42 }; | |
| 43 | |
| 44 } // namespace remoting | |
| 45 | |
| 46 #endif // REMOTING_CLIENT_PLUGIN_TOUCH_INPUT_SCALER_H_ | |
| OLD | NEW |