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

Side by Side Diff: content/browser/renderer_host/input/synthetic_touchscreen_pinch_gesture.cc

Issue 2336803003: Make SyntheticPointerAction to flush the pointer action sequence (Closed)
Patch Set: controller Created 3 years, 12 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 | « content/browser/renderer_host/input/synthetic_touch_driver.cc ('k') | content/common/BUILD.gn » ('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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/renderer_host/input/synthetic_touchscreen_pinch_gestur e.h" 5 #include "content/browser/renderer_host/input/synthetic_touchscreen_pinch_gestur e.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include <cmath> 9 #include <cmath>
10 10
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 case SETUP: 80 case SETUP:
81 NOTREACHED() << "State SETUP invalid for synthetic pinch."; 81 NOTREACHED() << "State SETUP invalid for synthetic pinch.";
82 case DONE: 82 case DONE:
83 NOTREACHED() << "State DONE invalid for synthetic pinch."; 83 NOTREACHED() << "State DONE invalid for synthetic pinch.";
84 } 84 }
85 } 85 }
86 86
87 void SyntheticTouchscreenPinchGesture::PressTouchPoints( 87 void SyntheticTouchscreenPinchGesture::PressTouchPoints(
88 SyntheticGestureTarget* target, 88 SyntheticGestureTarget* target,
89 const base::TimeTicks& timestamp) { 89 const base::TimeTicks& timestamp) {
90 synthetic_pointer_driver_->Press(params_.anchor.x(), start_y_0_); 90 synthetic_pointer_driver_->Press(params_.anchor.x(), start_y_0_, 0);
91 synthetic_pointer_driver_->Press(params_.anchor.x(), start_y_1_); 91 synthetic_pointer_driver_->Press(params_.anchor.x(), start_y_1_, 1);
92 synthetic_pointer_driver_->DispatchEvent(target, timestamp); 92 synthetic_pointer_driver_->DispatchEvent(target, timestamp);
93 } 93 }
94 94
95 void SyntheticTouchscreenPinchGesture::MoveTouchPoints( 95 void SyntheticTouchscreenPinchGesture::MoveTouchPoints(
96 SyntheticGestureTarget* target, 96 SyntheticGestureTarget* target,
97 float delta, 97 float delta,
98 const base::TimeTicks& timestamp) { 98 const base::TimeTicks& timestamp) {
99 // The two pointers move in opposite directions. 99 // The two pointers move in opposite directions.
100 float current_y_0 = start_y_0_ + delta; 100 float current_y_0 = start_y_0_ + delta;
101 float current_y_1 = start_y_1_ - delta; 101 float current_y_1 = start_y_1_ - delta;
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 const base::TimeTicks& timestamp) const { 163 const base::TimeTicks& timestamp) const {
164 return std::min(timestamp, stop_time_); 164 return std::min(timestamp, stop_time_);
165 } 165 }
166 166
167 bool SyntheticTouchscreenPinchGesture::HasReachedTarget( 167 bool SyntheticTouchscreenPinchGesture::HasReachedTarget(
168 const base::TimeTicks& timestamp) const { 168 const base::TimeTicks& timestamp) const {
169 return timestamp >= stop_time_; 169 return timestamp >= stop_time_;
170 } 170 }
171 171
172 } // namespace content 172 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/input/synthetic_touch_driver.cc ('k') | content/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698