Index: ui/views/controls/resize_area.h |
diff --git a/ui/views/controls/resize_area.h b/ui/views/controls/resize_area.h |
index 171c805656d9873aba25a6a419b88382ac458239..31dc6e35235b9ae72a62afad8c3b1489387bb9d0 100644 |
--- a/ui/views/controls/resize_area.h |
+++ b/ui/views/controls/resize_area.h |
@@ -14,11 +14,7 @@ namespace views { |
class ResizeAreaDelegate; |
-//////////////////////////////////////////////////////////////////////////////// |
-// |
// An invisible area that acts like a horizontal resizer. |
-// |
-//////////////////////////////////////////////////////////////////////////////// |
class VIEWS_EXPORT ResizeArea : public View { |
public: |
static const char kViewClassName[]; |
@@ -26,9 +22,10 @@ class VIEWS_EXPORT ResizeArea : public View { |
explicit ResizeArea(ResizeAreaDelegate* delegate); |
~ResizeArea() override; |
- // Overridden from views::View: |
+ // views::View: |
const char* GetClassName() const override; |
gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override; |
+ void OnGestureEvent(ui::GestureEvent* event) override; |
bool OnMousePressed(const ui::MouseEvent& event) override; |
bool OnMouseDragged(const ui::MouseEvent& event) override; |
void OnMouseReleased(const ui::MouseEvent& event) override; |
@@ -40,10 +37,16 @@ class VIEWS_EXPORT ResizeArea : public View { |
// directionality. |
void ReportResizeAmount(int resize_amount, bool last_update); |
+ // Converts |event_x| to screen coordinates and sets |initial_position_| to |
+ // this value. |
+ void SetInitialPosition(int event_x); |
+ |
// The delegate to notify when we have updates. |
ResizeAreaDelegate* delegate_; |
- // The mouse position at start (in screen coordinates). |
+ // The event's x-position at the start of the resize operation. The resize |
+ // area will move while being dragged, so |initial_position_| is represented |
+ // in screen coordinates so that we don't lose our bearings. |
int initial_position_; |
DISALLOW_COPY_AND_ASSIGN(ResizeArea); |