| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_UI_DIRECT_INPUT_STRATEGY_H_ | 5 #ifndef REMOTING_CLIENT_UI_DIRECT_INPUT_STRATEGY_H_ |
| 6 #define REMOTING_CLIENT_UI_DIRECT_INPUT_STRATEGY_H_ | 6 #define REMOTING_CLIENT_UI_DIRECT_INPUT_STRATEGY_H_ |
| 7 | 7 |
| 8 #include "remoting/client/ui/input_strategy.h" | 8 #include "remoting/client/ui/input_strategy.h" |
| 9 | 9 |
| 10 namespace remoting { | 10 namespace remoting { |
| 11 | 11 |
| 12 // This strategy directly translates all operations on the OpenGL view into | 12 // This strategy directly translates all operations on the OpenGL view into |
| 13 // corresponding operations on the desktop. It doesn't maintain the cursor | 13 // corresponding operations on the desktop. It doesn't maintain the cursor |
| 14 // positions separately -- the positions come from the location of the touch. | 14 // positions separately -- the positions come from the location of the touch. |
| 15 class DirectInputStrategy : public InputStrategy { | 15 class DirectInputStrategy : public InputStrategy { |
| 16 public: | 16 public: |
| 17 DirectInputStrategy(); | 17 DirectInputStrategy(); |
| 18 ~DirectInputStrategy() override; | 18 ~DirectInputStrategy() override; |
| 19 | 19 |
| 20 // InputStrategy overrides. | 20 // InputStrategy overrides. |
| 21 | 21 |
| 22 void HandlePinch(const ViewMatrix::Point& pivot, | 22 void HandleZoom(const ViewMatrix::Point& pivot, |
| 23 float scale, | 23 float scale, |
| 24 DesktopViewport* viewport) override; | 24 DesktopViewport* viewport) override; |
| 25 | 25 |
| 26 void HandlePan(const ViewMatrix::Vector2D& translation, | 26 bool HandlePan(const ViewMatrix::Vector2D& translation, |
| 27 bool is_dragging_mode, | 27 Gesture simultaneous_gesture, |
| 28 DesktopViewport* viewport) override; | 28 DesktopViewport* viewport) override; |
| 29 | 29 |
| 30 void TrackTouchInput(const ViewMatrix::Point& touch_point, | 30 void TrackTouchInput(const ViewMatrix::Point& touch_point, |
| 31 const DesktopViewport& viewport) override; | 31 const DesktopViewport& viewport) override; |
| 32 | 32 |
| 33 ViewMatrix::Point GetCursorPosition() const override; | 33 ViewMatrix::Point GetCursorPosition() const override; |
| 34 | 34 |
| 35 ViewMatrix::Vector2D MapScreenVectorToDesktop( | 35 ViewMatrix::Vector2D MapScreenVectorToDesktop( |
| 36 const ViewMatrix::Vector2D& delta, | 36 const ViewMatrix::Vector2D& delta, |
| 37 const DesktopViewport& viewport) const override; | 37 const DesktopViewport& viewport) const override; |
| 38 | 38 |
| 39 float GetFeedbackRadius(InputFeedbackType type) const override; | 39 float GetFeedbackRadius(InputFeedbackType type) const override; |
| 40 | 40 |
| 41 bool IsCursorVisible() const override; | 41 bool IsCursorVisible() const override; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 ViewMatrix::Point cursor_position_{0.f, 0.f}; | 44 ViewMatrix::Point cursor_position_{0.f, 0.f}; |
| 45 | 45 |
| 46 // TouchInputStrategy is neither copyable nor movable. | 46 // TouchInputStrategy is neither copyable nor movable. |
| 47 DirectInputStrategy(const DirectInputStrategy&) = delete; | 47 DirectInputStrategy(const DirectInputStrategy&) = delete; |
| 48 DirectInputStrategy& operator=(const DirectInputStrategy&) = delete; | 48 DirectInputStrategy& operator=(const DirectInputStrategy&) = delete; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace remoting | 51 } // namespace remoting |
| 52 #endif // REMOTING_CLIENT_UI_DIRECT_INPUT_STRATEGY_H_ | 52 #endif // REMOTING_CLIENT_UI_DIRECT_INPUT_STRATEGY_H_ |
| OLD | NEW |