| Index: remoting/client/direct_input_strategy.cc
|
| diff --git a/remoting/client/direct_input_strategy.cc b/remoting/client/direct_input_strategy.cc
|
| index 13d54faa9d881cafbb5e6ce6ca6fd546530fae15..e7cf925fbfef303a3e12bac9bdd5d84263aa8df2 100644
|
| --- a/remoting/client/direct_input_strategy.cc
|
| +++ b/remoting/client/direct_input_strategy.cc
|
| @@ -3,10 +3,18 @@
|
| // found in the LICENSE file.
|
|
|
| #include "remoting/client/direct_input_strategy.h"
|
| +
|
| #include "remoting/client/desktop_viewport.h"
|
|
|
| namespace remoting {
|
|
|
| +namespace {
|
| +
|
| +const float kTapFeedbackRadius = 25.f;
|
| +const float kLongPressFeedbackRadius = 55.f;
|
| +
|
| +} // namespace
|
| +
|
| DirectInputStrategy::DirectInputStrategy() {}
|
|
|
| DirectInputStrategy::~DirectInputStrategy() {}
|
| @@ -36,15 +44,30 @@ void DirectInputStrategy::HandlePan(float translation_x,
|
| viewport->MoveDesktop(translation_x, translation_y);
|
| }
|
|
|
| -void DirectInputStrategy::FindCursorPositions(float touch_x,
|
| - float touch_y,
|
| - const DesktopViewport& viewport,
|
| - float* cursor_x,
|
| - float* cursor_y) {
|
| +void DirectInputStrategy::TrackTouchInput(float touch_x,
|
| + float touch_y,
|
| + const DesktopViewport& viewport) {
|
| ViewMatrix::Point cursor_position =
|
| viewport.GetTransformation().Invert().MapPoint({touch_x, touch_y});
|
| - *cursor_x = cursor_position.x;
|
| - *cursor_y = cursor_position.y;
|
| + cursor_x_ = cursor_position.x;
|
| + cursor_y_ = cursor_position.y;
|
| +}
|
| +
|
| +void DirectInputStrategy::GetCursorPosition(float* cursor_x,
|
| + float* cursor_y) const {
|
| + *cursor_x = cursor_x_;
|
| + *cursor_y = cursor_y_;
|
| +}
|
| +
|
| +float DirectInputStrategy::GetFeedbackRadius(InputFeedbackType type) const {
|
| + switch (type) {
|
| + case InputFeedbackType::TAP_FEEDBACK:
|
| + return kTapFeedbackRadius;
|
| + case InputFeedbackType::LONG_PRESS_FEEDBACK:
|
| + return kLongPressFeedbackRadius;
|
| + default:
|
| + NOTREACHED();
|
| + }
|
| }
|
|
|
| bool DirectInputStrategy::IsCursorVisible() const {
|
|
|