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

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

Issue 2897143002: [CRD iOS] Ignore touch event when the touch point is out of the canvas in direct input mode (Closed)
Patch Set: 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/gesture_interpreter.h ('k') | remoting/client/ui/input_strategy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/client/ui/gesture_interpreter.cc
diff --git a/remoting/client/ui/gesture_interpreter.cc b/remoting/client/ui/gesture_interpreter.cc
index bef09ca9b100673a22e2b70265e6e2c5088510cd..f307077e6153d3b659465c61a0869abd1ec9726a 100644
--- a/remoting/client/ui/gesture_interpreter.cc
+++ b/remoting/client/ui/gesture_interpreter.cc
@@ -76,7 +76,10 @@ void GestureInterpreter::Pan(float translation_x, float translation_y) {
void GestureInterpreter::Tap(float x, float y) {
AbortAnimations();
- ViewMatrix::Point cursor_position = TrackAndGetPosition(x, y);
+ if (!input_strategy_->TrackTouchInput({x, y}, viewport_)) {
+ return;
+ }
+ ViewMatrix::Point cursor_position = input_strategy_->GetCursorPosition();
StartInputFeedback(cursor_position.x, cursor_position.y,
InputStrategy::TAP_FEEDBACK);
InjectMouseClick(cursor_position.x, cursor_position.y,
@@ -86,7 +89,10 @@ void GestureInterpreter::Tap(float x, float y) {
void GestureInterpreter::TwoFingerTap(float x, float y) {
AbortAnimations();
- ViewMatrix::Point cursor_position = TrackAndGetPosition(x, y);
+ if (!input_strategy_->TrackTouchInput({x, y}, viewport_)) {
+ return;
+ }
+ ViewMatrix::Point cursor_position = input_strategy_->GetCursorPosition();
InjectMouseClick(cursor_position.x, cursor_position.y,
protocol::MouseEvent_MouseButton_BUTTON_RIGHT);
}
@@ -94,7 +100,10 @@ void GestureInterpreter::TwoFingerTap(float x, float y) {
void GestureInterpreter::Drag(float x, float y, GestureState state) {
AbortAnimations();
- ViewMatrix::Point cursor_position = TrackAndGetPosition(x, y);
+ if (!input_strategy_->TrackTouchInput({x, y}, viewport_)) {
+ return;
+ }
+ ViewMatrix::Point cursor_position = input_strategy_->GetCursorPosition();
if (state == GESTURE_BEGAN) {
StartInputFeedback(cursor_position.x, cursor_position.y,
@@ -117,7 +126,10 @@ void GestureInterpreter::OneFingerFling(float velocity_x, float velocity_y) {
void GestureInterpreter::Scroll(float x, float y, float dx, float dy) {
AbortAnimations();
- ViewMatrix::Point cursor_position = TrackAndGetPosition(x, y);
+ if (!input_strategy_->TrackTouchInput({x, y}, viewport_)) {
+ return;
+ }
+ ViewMatrix::Point cursor_position = input_strategy_->GetCursorPosition();
// Inject the cursor position to the host so that scrolling can happen on the
// right place.
@@ -197,12 +209,6 @@ void GestureInterpreter::SetGestureInProgress(InputStrategy::Gesture gesture,
gesture_in_progress_ = gesture;
}
-ViewMatrix::Point GestureInterpreter::TrackAndGetPosition(float touch_x,
- float touch_y) {
- input_strategy_->TrackTouchInput({touch_x, touch_y}, viewport_);
- return input_strategy_->GetCursorPosition();
-}
-
void GestureInterpreter::StartInputFeedback(
float cursor_x,
float cursor_y,
« no previous file with comments | « remoting/client/ui/gesture_interpreter.h ('k') | remoting/client/ui/input_strategy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698