OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "remoting/client/gesture_interpreter.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 namespace remoting { |
| 10 |
| 11 GestureInterpreter::GestureInterpreter( |
| 12 const DesktopViewport::TransformationCallback& on_transformation_changed) { |
| 13 viewport_.RegisterOnTransformationChangedCallback(on_transformation_changed, |
| 14 true); |
| 15 } |
| 16 |
| 17 GestureInterpreter::~GestureInterpreter() {} |
| 18 |
| 19 void GestureInterpreter::Pinch(float pivot_x, float pivot_y, float scale) { |
| 20 viewport_.ScaleDesktop(pivot_x, pivot_y, scale); |
| 21 } |
| 22 |
| 23 void GestureInterpreter::Pan(float translation_x, float translation_y) { |
| 24 // TODO(yuweih): Handle trackpad mode where the viewport always focus on the |
| 25 // cursor. |
| 26 viewport_.MoveDesktop(translation_x, translation_y); |
| 27 } |
| 28 |
| 29 void GestureInterpreter::Tap(float x, float y) { |
| 30 NOTIMPLEMENTED(); |
| 31 } |
| 32 |
| 33 void GestureInterpreter::LongPress(float x, float y) { |
| 34 NOTIMPLEMENTED(); |
| 35 } |
| 36 |
| 37 void GestureInterpreter::OnSurfaceSizeChanged(int width, int height) { |
| 38 viewport_.SetSurfaceSize(width, height); |
| 39 } |
| 40 |
| 41 void GestureInterpreter::OnDesktopSizeChanged(int width, int height) { |
| 42 viewport_.SetDesktopSize(width, height); |
| 43 } |
| 44 |
| 45 } // namespace remoting |
OLD | NEW |