| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_LONGPRESS_DRAG_SELECTOR_H_ | 5 #ifndef UI_TOUCH_SELECTION_LONGPRESS_DRAG_SELECTOR_H_ |
| 6 #define UI_TOUCH_SELECTION_LONGPRESS_DRAG_SELECTOR_H_ | 6 #define UI_TOUCH_SELECTION_LONGPRESS_DRAG_SELECTOR_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "ui/gfx/geometry/point_f.h" | 9 #include "ui/gfx/geometry/point_f.h" |
| 10 #include "ui/gfx/geometry/vector2d_f.h" | 10 #include "ui/gfx/geometry/vector2d_f.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 ~LongPressDragSelector() override; | 33 ~LongPressDragSelector() override; |
| 34 | 34 |
| 35 // TouchSelectionDraggable implementation. | 35 // TouchSelectionDraggable implementation. |
| 36 bool WillHandleTouchEvent(const MotionEvent& event) override; | 36 bool WillHandleTouchEvent(const MotionEvent& event) override; |
| 37 bool IsActive() const override; | 37 bool IsActive() const override; |
| 38 | 38 |
| 39 // Called just prior to a longpress event being handled. | 39 // Called just prior to a longpress event being handled. |
| 40 void OnLongPressEvent(base::TimeTicks event_time, | 40 void OnLongPressEvent(base::TimeTicks event_time, |
| 41 const gfx::PointF& position); | 41 const gfx::PointF& position); |
| 42 | 42 |
| 43 // Called when a scroll is going to happen to cancel longpress-drag gesture. |
| 44 void OnScrollBeginEvent(); |
| 45 |
| 43 // Called when the active selection changes. | 46 // Called when the active selection changes. |
| 44 void OnSelectionActivated(); | 47 void OnSelectionActivated(); |
| 45 void OnSelectionDeactivated(); | 48 void OnSelectionDeactivated(); |
| 46 | 49 |
| 47 private: | 50 private: |
| 48 enum SelectionState { | 51 enum SelectionState { |
| 49 INACTIVE, | 52 INACTIVE, |
| 50 LONGPRESS_PENDING, | 53 LONGPRESS_PENDING, |
| 51 SELECTION_PENDING, | 54 SELECTION_PENDING, |
| 52 DRAG_PENDING, | 55 DRAG_PENDING, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 63 gfx::PointF touch_down_position_; | 66 gfx::PointF touch_down_position_; |
| 64 | 67 |
| 65 gfx::Vector2dF longpress_drag_selection_offset_; | 68 gfx::Vector2dF longpress_drag_selection_offset_; |
| 66 gfx::PointF longpress_drag_start_anchor_; | 69 gfx::PointF longpress_drag_start_anchor_; |
| 67 bool has_longpress_drag_start_anchor_; | 70 bool has_longpress_drag_start_anchor_; |
| 68 }; | 71 }; |
| 69 | 72 |
| 70 } // namespace ui | 73 } // namespace ui |
| 71 | 74 |
| 72 #endif // UI_TOUCH_SELECTION_LONGPRESS_DRAG_SELECTOR_H_ | 75 #endif // UI_TOUCH_SELECTION_LONGPRESS_DRAG_SELECTOR_H_ |
| OLD | NEW |