OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ | 5 #ifndef UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ |
6 #define UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ | 6 #define UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ |
7 | 7 |
8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
9 #include "ui/base/touch/selection_bound.h" | 9 #include "ui/base/touch/selection_bound.h" |
10 #include "ui/gfx/geometry/point_f.h" | 10 #include "ui/gfx/geometry/point_f.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // showing the insertion handle from subsequent bounds changes. | 94 // showing the insertion handle from subsequent bounds changes. |
95 // |tap_count| is tap index in a repeated sequence, i.e., 1 for the first | 95 // |tap_count| is tap index in a repeated sequence, i.e., 1 for the first |
96 // tap, 2 for the second tap, etc... | 96 // tap, 2 for the second tap, etc... |
97 bool WillHandleTapEvent(const gfx::PointF& location, int tap_count); | 97 bool WillHandleTapEvent(const gfx::PointF& location, int tap_count); |
98 | 98 |
99 // To be called before forwarding a longpress event. This allows automatically | 99 // To be called before forwarding a longpress event. This allows automatically |
100 // showing the selection or insertion handles from subsequent bounds changes. | 100 // showing the selection or insertion handles from subsequent bounds changes. |
101 bool WillHandleLongPressEvent(base::TimeTicks event_time, | 101 bool WillHandleLongPressEvent(base::TimeTicks event_time, |
102 const gfx::PointF& location); | 102 const gfx::PointF& location); |
103 | 103 |
| 104 // To be called before forwarding a gesture scroll begin event to prevent |
| 105 // long-press drag. |
| 106 void OnScrollBeginEvent(); |
| 107 |
104 // Allow showing the selection handles from the most recent selection bounds | 108 // Allow showing the selection handles from the most recent selection bounds |
105 // update (if valid), or a future valid bounds update. | 109 // update (if valid), or a future valid bounds update. |
106 void AllowShowingFromCurrentSelection(); | 110 void AllowShowingFromCurrentSelection(); |
107 | 111 |
108 // Hide the handles and suppress bounds updates until the next explicit | 112 // Hide the handles and suppress bounds updates until the next explicit |
109 // showing allowance. | 113 // showing allowance. |
110 void HideAndDisallowShowingAutomatically(); | 114 void HideAndDisallowShowingAutomatically(); |
111 | 115 |
112 // Override the handle visibility according to |hidden|. | 116 // Override the handle visibility according to |hidden|. |
113 void SetTemporarilyHidden(bool hidden); | 117 void SetTemporarilyHidden(bool hidden); |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 // Whether a selection handle was dragged during the current 'selection | 240 // Whether a selection handle was dragged during the current 'selection |
237 // session' - i.e. since the current selection has been activated. | 241 // session' - i.e. since the current selection has been activated. |
238 bool selection_handle_dragged_; | 242 bool selection_handle_dragged_; |
239 | 243 |
240 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); | 244 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); |
241 }; | 245 }; |
242 | 246 |
243 } // namespace ui | 247 } // namespace ui |
244 | 248 |
245 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ | 249 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ |
OLD | NEW |