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

Unified Diff: remoting/client/ui/direct_input_strategy.cc

Issue 2891603002: [CRD iOS] Trackpad Input Mode (Closed)
Patch Set: Fix 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « remoting/client/ui/direct_input_strategy.h ('k') | remoting/client/ui/gesture_interpreter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/ui/direct_input_strategy.cc
diff --git a/remoting/client/ui/direct_input_strategy.cc b/remoting/client/ui/direct_input_strategy.cc
index 5159062c176021c57515c28162013dfc030bd379..f749fe3f963df2f968d2aace87e5b36e215e54ad 100644
--- a/remoting/client/ui/direct_input_strategy.cc
+++ b/remoting/client/ui/direct_input_strategy.cc
@@ -10,7 +10,7 @@ namespace remoting {
namespace {
const float kTapFeedbackRadius = 25.f;
-const float kLongPressFeedbackRadius = 55.f;
+const float kDragFeedbackRadius = 55.f;
} // namespace
@@ -18,26 +18,27 @@ DirectInputStrategy::DirectInputStrategy() {}
DirectInputStrategy::~DirectInputStrategy() {}
-void DirectInputStrategy::HandlePinch(const ViewMatrix::Point& pivot,
- float scale,
- DesktopViewport* viewport) {
+void DirectInputStrategy::HandleZoom(const ViewMatrix::Point& pivot,
+ float scale,
+ DesktopViewport* viewport) {
viewport->ScaleDesktop(pivot.x, pivot.y, scale);
}
-void DirectInputStrategy::HandlePan(const ViewMatrix::Vector2D& translation,
- bool is_dragging_mode,
+bool DirectInputStrategy::HandlePan(const ViewMatrix::Vector2D& translation,
+ Gesture simultaneous_gesture,
DesktopViewport* viewport) {
- if (is_dragging_mode) {
+ if (simultaneous_gesture == DRAG) {
// If the user is dragging something, we should synchronize the movement
// with the object that the user is trying to move on the desktop, rather
// than moving the desktop around.
ViewMatrix::Vector2D viewport_movement =
viewport->GetTransformation().Invert().MapVector(translation);
viewport->MoveViewport(viewport_movement.x, viewport_movement.y);
- return;
+ return false;
}
viewport->MoveDesktop(translation.x, translation.y);
+ return false;
}
void DirectInputStrategy::TrackTouchInput(const ViewMatrix::Point& touch_point,
@@ -60,8 +61,8 @@ float DirectInputStrategy::GetFeedbackRadius(InputFeedbackType type) const {
switch (type) {
case InputFeedbackType::TAP_FEEDBACK:
return kTapFeedbackRadius;
- case InputFeedbackType::LONG_PRESS_FEEDBACK:
- return kLongPressFeedbackRadius;
+ case InputFeedbackType::DRAG_FEEDBACK:
+ return kDragFeedbackRadius;
}
NOTREACHED();
return 0.f;
« no previous file with comments | « remoting/client/ui/direct_input_strategy.h ('k') | remoting/client/ui/gesture_interpreter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698