Index: ui/touch_selection/touch_handle.h |
diff --git a/ui/touch_selection/touch_handle.h b/ui/touch_selection/touch_handle.h |
index 12c66d09983626db3c3f9b4a356aa80a2a9d9178..29b4ac678f7b32b58c49067a99826f171da28177 100644 |
--- a/ui/touch_selection/touch_handle.h |
+++ b/ui/touch_selection/touch_handle.h |
@@ -24,7 +24,9 @@ class UI_TOUCH_SELECTION_EXPORT TouchHandleDrawable { |
public: |
virtual ~TouchHandleDrawable() {} |
virtual void SetEnabled(bool enabled) = 0; |
- virtual void SetOrientation(TouchHandleOrientation orientation) = 0; |
+ virtual void SetOrientation(TouchHandleOrientation orientation, |
+ bool mirror_vertical, |
+ bool mirror_horizontal) = 0; |
virtual void SetAlpha(float alpha) = 0; |
virtual void SetFocus(const gfx::PointF& position) = 0; |
virtual gfx::RectF GetVisibleBounds() const = 0; |
@@ -66,10 +68,17 @@ class UI_TOUCH_SELECTION_EXPORT TouchHandle { |
// If an animation is in-progress, it will be overriden appropriately. |
void SetVisible(bool visible, AnimationStyle animation_style); |
- // Update the handle placement to |position|. |
+ // Update the handle placement to appropriate position based on mirror params. |
// Note: If a fade out animation is active or the handle is invisible, the |
// handle position will not be updated until the handle regains visibility. |
- void SetPosition(const gfx::PointF& position); |
+ void UpdatePosition(); |
+ |
+ // Update the focus points for the handles. The Handle will be positioned |
+ // either |top| or |bottom| based on the mirror parameters. |
+ void SetFocus(const gfx::PointF& top, const gfx::PointF& bottom); |
+ |
+ // Update the Viewport rect, based on which the handle decide its inversion |
+ void SetViewportRect(const gfx::RectF viewport_rect); |
// Update the handle visuals to |orientation|. |
// Note: If the handle is being dragged, the orientation change will be |
@@ -94,12 +103,16 @@ class UI_TOUCH_SELECTION_EXPORT TouchHandle { |
void BeginFade(); |
void EndFade(); |
void SetAlpha(float alpha); |
+ bool SetMirrorParameters(); |
scoped_ptr<TouchHandleDrawable> drawable_; |
TouchHandleClient* const client_; |
gfx::PointF position_; |
+ gfx::PointF focus_bottom_; |
+ gfx::PointF focus_top_; |
+ gfx::RectF viewport_rect_; |
TouchHandleOrientation orientation_; |
TouchHandleOrientation deferred_orientation_; |
@@ -120,6 +133,10 @@ class UI_TOUCH_SELECTION_EXPORT TouchHandle { |
bool is_dragging_; |
bool is_drag_within_tap_region_; |
+ // Mirror variables determine if the handles should be inverted or not. |
+ bool mirror_vertical_; |
+ bool mirror_horizontal_; |
+ |
DISALLOW_COPY_AND_ASSIGN(TouchHandle); |
}; |