| 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 const SelectionBound& end() const { return end_; } | 139 const SelectionBound& end() const { return end_; } |
| 140 | 140 |
| 141 ActiveStatus active_status() const { return active_status_; } | 141 ActiveStatus active_status() const { return active_status_; } |
| 142 | 142 |
| 143 private: | 143 private: |
| 144 friend class TouchSelectionControllerTestApi; | 144 friend class TouchSelectionControllerTestApi; |
| 145 | 145 |
| 146 enum InputEventType { TAP, REPEATED_TAP, LONG_PRESS, INPUT_EVENT_TYPE_NONE }; | 146 enum InputEventType { TAP, REPEATED_TAP, LONG_PRESS, INPUT_EVENT_TYPE_NONE }; |
| 147 | 147 |
| 148 // TouchHandleClient implementation. | 148 // TouchHandleClient implementation. |
| 149 void OnDragBegin(const TouchSelectionDraggable& draggable, | 149 void OnDragEvent(const TouchHandleDragEvent event, |
| 150 const gfx::PointF& drag_position) override; | 150 const TouchSelectionDraggable& draggable, |
| 151 void OnDragUpdate(const TouchSelectionDraggable& draggable, | 151 const gfx::PointF& start_position) override; |
| 152 const gfx::PointF& drag_position) override; | |
| 153 void OnDragEnd(const TouchSelectionDraggable& draggable) override; | |
| 154 bool IsWithinTapSlop(const gfx::Vector2dF& delta) const override; | 152 bool IsWithinTapSlop(const gfx::Vector2dF& delta) const override; |
| 155 void OnHandleTapped(const TouchHandle& handle) override; | 153 void OnHandleTapped(const TouchHandle& handle) override; |
| 156 void SetNeedsAnimate() override; | 154 void SetNeedsAnimate() override; |
| 157 scoped_ptr<TouchHandleDrawable> CreateDrawable() override; | 155 scoped_ptr<TouchHandleDrawable> CreateDrawable() override; |
| 158 base::TimeDelta GetMaxTapDuration() const override; | 156 base::TimeDelta GetMaxTapDuration() const override; |
| 159 bool IsAdaptiveHandleOrientationEnabled() const override; | 157 bool IsAdaptiveHandleOrientationEnabled() const override; |
| 160 | 158 |
| 159 void HandleDragBegin(const TouchSelectionDraggable& draggable, |
| 160 const gfx::PointF& drag_position); |
| 161 void HandleDragUpdate(const TouchSelectionDraggable& draggable, |
| 162 const gfx::PointF& drag_position); |
| 163 void HandleDragEnd(const TouchSelectionDraggable& draggable); |
| 164 |
| 161 // LongPressDragSelectorClient implementation. | 165 // LongPressDragSelectorClient implementation. |
| 162 void OnLongPressDragActiveStateChanged() override; | 166 void OnLongPressDragActiveStateChanged() override; |
| 163 gfx::PointF GetSelectionStart() const override; | 167 gfx::PointF GetSelectionStart() const override; |
| 164 gfx::PointF GetSelectionEnd() const override; | 168 gfx::PointF GetSelectionEnd() const override; |
| 165 | 169 |
| 166 void ShowInsertionHandleAutomatically(); | 170 void ShowInsertionHandleAutomatically(); |
| 167 void ShowSelectionHandlesAutomatically(); | 171 void ShowSelectionHandlesAutomatically(); |
| 168 bool WillHandleTapOrLongPress(const gfx::PointF& location); | 172 bool WillHandleTapOrLongPress(const gfx::PointF& location); |
| 169 | 173 |
| 170 void OnInsertionChanged(); | 174 void OnInsertionChanged(); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // Whether a selection handle was dragged during the current 'selection | 238 // Whether a selection handle was dragged during the current 'selection |
| 235 // session' - i.e. since the current selection has been activated. | 239 // session' - i.e. since the current selection has been activated. |
| 236 bool selection_handle_dragged_; | 240 bool selection_handle_dragged_; |
| 237 | 241 |
| 238 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); | 242 DISALLOW_COPY_AND_ASSIGN(TouchSelectionController); |
| 239 }; | 243 }; |
| 240 | 244 |
| 241 } // namespace ui | 245 } // namespace ui |
| 242 | 246 |
| 243 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ | 247 #endif // UI_TOUCH_SELECTION_TOUCH_SELECTION_CONTROLLER_H_ |
| OLD | NEW |