| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "ui/gfx/geometry/point_f.h" | 10 #include "ui/gfx/geometry/point_f.h" |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 | 143 |
| 144 bool insertion_active_or_requested() const { | 144 bool insertion_active_or_requested() const { |
| 145 return activate_insertion_automatically_; | 145 return activate_insertion_automatically_; |
| 146 } | 146 } |
| 147 | 147 |
| 148 private: | 148 private: |
| 149 friend class TouchSelectionControllerTestApi; | 149 friend class TouchSelectionControllerTestApi; |
| 150 | 150 |
| 151 enum InputEventType { TAP, REPEATED_TAP, LONG_PRESS, INPUT_EVENT_TYPE_NONE }; | 151 enum InputEventType { TAP, REPEATED_TAP, LONG_PRESS, INPUT_EVENT_TYPE_NONE }; |
| 152 | 152 |
| 153 bool WillHandleTouchEventImpl(const MotionEvent& event); |
| 154 |
| 153 // TouchHandleClient implementation. | 155 // TouchHandleClient implementation. |
| 154 void OnDragBegin(const TouchSelectionDraggable& draggable, | 156 void OnDragBegin(const TouchSelectionDraggable& draggable, |
| 155 const gfx::PointF& drag_position) override; | 157 const gfx::PointF& drag_position) override; |
| 156 void OnDragUpdate(const TouchSelectionDraggable& draggable, | 158 void OnDragUpdate(const TouchSelectionDraggable& draggable, |
| 157 const gfx::PointF& drag_position) override; | 159 const gfx::PointF& drag_position) override; |
| 158 void OnDragEnd(const TouchSelectionDraggable& draggable) override; | 160 void OnDragEnd(const TouchSelectionDraggable& draggable) override; |
| 159 bool IsWithinTapSlop(const gfx::Vector2dF& delta) const override; | 161 bool IsWithinTapSlop(const gfx::Vector2dF& delta) const override; |
| 160 void OnHandleTapped(const TouchHandle& handle) override; | 162 void OnHandleTapped(const TouchHandle& handle) override; |
| 161 void SetNeedsAnimate() override; | 163 void SetNeedsAnimate() override; |
| 162 std::unique_ptr<TouchHandleDrawable> CreateDrawable() override; | 164 std::unique_ptr<TouchHandleDrawable> CreateDrawable() override; |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 // Longpress drag allows direct manipulation of longpress-initiated selection. | 235 // Longpress drag allows direct manipulation of longpress-initiated selection. |
| 234 LongPressDragSelector longpress_drag_selector_; | 236 LongPressDragSelector longpress_drag_selector_; |
| 235 | 237 |
| 236 gfx::RectF viewport_rect_; | 238 gfx::RectF viewport_rect_; |
| 237 | 239 |
| 238 base::TimeTicks selection_start_time_; | 240 base::TimeTicks selection_start_time_; |
| 239 // Whether a selection handle was dragged during the current 'selection | 241 // Whether a selection handle was dragged during the current 'selection |
| 240 // session' - i.e. since the current selection has been activated. | 242 // session' - i.e. since the current selection has been activated. |
| 241 bool selection_handle_dragged_; | 243 bool selection_handle_dragged_; |
| 242 | 244 |
| 245 // Determines whether the entire touch sequence should be consumed or not. |
| 246 bool consume_touch_sequence_; |
| 247 |
| 243 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); | 248 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); |
| 244 }; | 249 }; |
| 245 | 250 |
| 246 } // namespace ui | 251 } // namespace ui |
| 247 | 252 |
| 248 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ | 253 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ |
| OLD | NEW |