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

Side by Side Diff: remoting/client/ui/direct_input_strategy.cc

Issue 2882653004: [CRD iOS] Injecting scroll events w/ fling animation (Closed)
Patch Set: Rebase 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/ui/direct_input_strategy.h ('k') | remoting/client/ui/fling_animation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "remoting/client/ui/direct_input_strategy.h" 5 #include "remoting/client/ui/direct_input_strategy.h"
6 #include "remoting/client/ui/desktop_viewport.h" 6 #include "remoting/client/ui/desktop_viewport.h"
7 7
8 namespace remoting { 8 namespace remoting {
9 9
10 namespace { 10 namespace {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 void DirectInputStrategy::TrackTouchInput(const ViewMatrix::Point& touch_point, 43 void DirectInputStrategy::TrackTouchInput(const ViewMatrix::Point& touch_point,
44 const DesktopViewport& viewport) { 44 const DesktopViewport& viewport) {
45 cursor_position_ = 45 cursor_position_ =
46 viewport.GetTransformation().Invert().MapPoint(touch_point); 46 viewport.GetTransformation().Invert().MapPoint(touch_point);
47 } 47 }
48 48
49 ViewMatrix::Point DirectInputStrategy::GetCursorPosition() const { 49 ViewMatrix::Point DirectInputStrategy::GetCursorPosition() const {
50 return cursor_position_; 50 return cursor_position_;
51 } 51 }
52 52
53 ViewMatrix::Vector2D DirectInputStrategy::MapScreenVectorToDesktop(
54 const ViewMatrix::Vector2D& delta,
55 const DesktopViewport& viewport) const {
56 return viewport.GetTransformation().Invert().MapVector(delta);
57 }
58
53 float DirectInputStrategy::GetFeedbackRadius(InputFeedbackType type) const { 59 float DirectInputStrategy::GetFeedbackRadius(InputFeedbackType type) const {
54 switch (type) { 60 switch (type) {
55 case InputFeedbackType::TAP_FEEDBACK: 61 case InputFeedbackType::TAP_FEEDBACK:
56 return kTapFeedbackRadius; 62 return kTapFeedbackRadius;
57 case InputFeedbackType::LONG_PRESS_FEEDBACK: 63 case InputFeedbackType::LONG_PRESS_FEEDBACK:
58 return kLongPressFeedbackRadius; 64 return kLongPressFeedbackRadius;
59 } 65 }
60 NOTREACHED(); 66 NOTREACHED();
61 return 0.f; 67 return 0.f;
62 } 68 }
63 69
64 bool DirectInputStrategy::IsCursorVisible() const { 70 bool DirectInputStrategy::IsCursorVisible() const {
65 return false; 71 return false;
66 } 72 }
67 73
68 } // namespace remoting 74 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/ui/direct_input_strategy.h ('k') | remoting/client/ui/fling_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698