OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |