OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 /** | 5 /** |
6 * @fileoverview Touch Handler. Class that handles all touch events and | 6 * @fileoverview Touch Handler. Class that handles all touch events and |
7 * uses them to interpret higher level gestures and behaviors. TouchEvent is a | 7 * uses them to interpret higher level gestures and behaviors. TouchEvent is a |
8 * built in mobile safari type: | 8 * built in mobile safari type: |
9 * http://developer.apple.com/safari/library/documentation/UserExperience/Refere
nce/TouchEventClassReference/TouchEvent/TouchEvent.html. | 9 * http://developer.apple.com/safari/library/documentation/UserExperience/Refere
nce/TouchEventClassReference/TouchEvent/TouchEvent.html. |
10 * This class is intended to work with all webkit browsers, tested on Chrome and | 10 * This class is intended to work with all webkit browsers, tested on Chrome and |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 * @type {number} | 60 * @type {number} |
61 * @private | 61 * @private |
62 */ | 62 */ |
63 this.totalMoveX_ = 0; | 63 this.totalMoveX_ = 0; |
64 | 64 |
65 /** | 65 /** |
66 * An array of tuples where the first item is the horizontal component of a | 66 * An array of tuples where the first item is the horizontal component of a |
67 * recent relevant touch and the second item is the touch's time stamp. Old | 67 * recent relevant touch and the second item is the touch's time stamp. Old |
68 * touches are removed based on the max tracking time and when direction | 68 * touches are removed based on the max tracking time and when direction |
69 * changes. | 69 * changes. |
70 * @type {!Array<number>} | 70 * @type {!Array<number>} |
71 * @private | 71 * @private |
72 */ | 72 */ |
73 this.recentTouchesX_ = []; | 73 this.recentTouchesX_ = []; |
74 | 74 |
75 /** | 75 /** |
76 * An array of tuples where the first item is the vertical component of a | 76 * An array of tuples where the first item is the vertical component of a |
77 * recent relevant touch and the second item is the touch's time stamp. Old | 77 * recent relevant touch and the second item is the touch's time stamp. Old |
78 * touches are removed based on the max tracking time and when direction | 78 * touches are removed based on the max tracking time and when direction |
79 * changes. | 79 * changes. |
80 * @type {!Array<number>} | 80 * @type {!Array<number>} |
81 * @private | 81 * @private |
82 */ | 82 */ |
(...skipping 788 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 event.dragDeltaY = clientY - this.startTouchY_; | 871 event.dragDeltaY = clientY - this.startTouchY_; |
872 } | 872 } |
873 | 873 |
874 this.element_.dispatchEvent(event); | 874 this.element_.dispatchEvent(event); |
875 return event.enableDrag; | 875 return event.enableDrag; |
876 } | 876 } |
877 }; | 877 }; |
878 | 878 |
879 return {TouchHandler: TouchHandler}; | 879 return {TouchHandler: TouchHandler}; |
880 }); | 880 }); |
OLD | NEW |