Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(698)

Side by Side Diff: remoting/client/gesture_interpreter.cc

Issue 2856933007: [Remoting iOS] Basic viewport manipulation support (Closed)
Patch Set: Move the delegate getter/setting to the bottom Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « remoting/client/gesture_interpreter.h ('k') | remoting/client/ios/app/host_view_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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
OLDNEW
« no previous file with comments | « remoting/client/gesture_interpreter.h ('k') | remoting/client/ios/app/host_view_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698