Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(514)

Unified Diff: ui/touch_selection/touch_selection_controller.h

Issue 481683003: Support for Adaptive Handle Orientation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/touch_selection/touch_handle_unittest.cc ('k') | ui/touch_selection/touch_selection_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 72e2ae23fe81f6dc1e08aa5fdc1a107bb7028524..797b7556444b46046c8f6b48908d4b8aae1af283 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.
@@ -148,6 +156,7 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController
void SetNeedsAnimate() override;
scoped_ptr<TouchHandleDrawable> CreateDrawable() override;
base::TimeDelta GetMaxTapDuration() const override;
+ bool IsAdaptiveHandleOrientationEnabled() const override;
// LongPressDragSelectorClient implementation.
void OnLongPressDragActiveStateChanged() override;
@@ -168,6 +177,7 @@ class UI_TOUCH_SELECTION_EXPORT TouchSelectionController
bool ActivateSelectionIfNecessary();
void DeactivateSelection();
void ForceNextUpdateIfInactive();
+ void UpdateHandleLayoutIfNecessary();
bool WillHandleTouchEventForLongPressDrag(const MotionEvent& event);
void SetTemporarilyHiddenForLongPressDrag(bool hidden);
@@ -218,6 +228,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.
« no previous file with comments | « ui/touch_selection/touch_handle_unittest.cc ('k') | ui/touch_selection/touch_selection_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698