Index: ui/touch_selection/touch_selection_controller.h |
diff --git a/ui/touch_selection/touch_selection_controller.h b/ui/touch_selection/touch_selection_controller.h |
index b31843680291dcb9f7e1a57dd758b9e73d55ef12..d62ba39c950398573c81d36f86e51c07a41974f2 100644 |
--- a/ui/touch_selection/touch_selection_controller.h |
+++ b/ui/touch_selection/touch_selection_controller.h |
@@ -56,6 +56,10 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController |
// Defaults to 8 DIPs. |
float tap_slop; |
+ // Controls whether adaptive orientation for selection handles is enabled. |
+ // Defaults to false. |
+ bool enable_adaptive_handle_orientation; |
+ |
// Controls whether drag selection after a longpress is enabled. |
// Defaults to false. |
bool enable_longpress_drag_selection; |
@@ -75,6 +79,10 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController |
void OnSelectionBoundsChanged(const SelectionBound& start, |
const SelectionBound& end); |
+ // To be called when the viewport rect has been changed. This is used for |
+ // setting the state of the handles. |
+ void OnViewportChanged(const gfx::RectF viewport_rect); |
+ |
// Allows touch-dragging of the handle. |
// Returns true iff the event was consumed, in which case the caller should |
// cease further handling of the event. |
@@ -146,6 +154,7 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController |
void SetNeedsAnimate() override; |
scoped_ptr<TouchHandleDrawable> CreateDrawable() override; |
base::TimeDelta GetTapTimeout() const override; |
+ bool IsEnabledAdaptiveHandleOrientation() const override; |
jdduke (slow)
2015/08/17 17:20:53
Let's rename this to |IsAdapativeHandleOrientation
AviD
2015/08/18 13:56:14
Done.
|
// LongPressDragSelectorClient implementation. |
void OnLongPressDragActiveStateChanged() override; |
@@ -166,6 +175,7 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController |
bool ActivateSelectionIfNecessary(); |
void DeactivateSelection(); |
void ForceNextUpdateIfInactive(); |
+ void UpdateHandleLayoutIfRequired(); |
jdduke (slow)
2015/08/17 17:20:53
Keeping with phrasing, let's call use "IfNecessary
AviD
2015/08/18 13:56:14
Done.
|
bool WillHandleTouchEventForLongPressDrag(const MotionEvent& event); |
void SetTemporarilyHiddenForLongPressDrag(bool hidden); |
@@ -216,6 +226,8 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController |
// Longpress drag allows direct manipulation of longpress-initiated selection. |
LongPressDragSelector longpress_drag_selector_; |
+ gfx::RectF viewport_rect_; |
+ |
base::TimeTicks selection_start_time_; |
// Whether a selection handle was dragged during the current 'selection |
// session' - i.e. since the current selection has been activated. |