| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_VIEWS_CONTROLS_RESIZE_AREA_H_ | 5 #ifndef UI_VIEWS_CONTROLS_RESIZE_AREA_H_ |
| 6 #define UI_VIEWS_CONTROLS_RESIZE_AREA_H_ | 6 #define UI_VIEWS_CONTROLS_RESIZE_AREA_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "ui/views/view.h" | 10 #include "ui/views/view.h" |
| 11 | 11 |
| 12 namespace views { | 12 namespace views { |
| 13 | 13 |
| 14 class ResizeAreaDelegate; | 14 class ResizeAreaDelegate; |
| 15 | 15 |
| 16 //////////////////////////////////////////////////////////////////////////////// | 16 //////////////////////////////////////////////////////////////////////////////// |
| 17 // | 17 // |
| 18 // An invisible area that acts like a horizontal resizer. | 18 // An invisible area that acts like a horizontal resizer. |
| 19 // | 19 // |
| 20 //////////////////////////////////////////////////////////////////////////////// | 20 //////////////////////////////////////////////////////////////////////////////// |
| 21 class VIEWS_EXPORT ResizeArea : public View { | 21 class VIEWS_EXPORT ResizeArea : public View { |
| 22 public: | 22 public: |
| 23 static const char kViewClassName[]; | 23 static const char kViewClassName[]; |
| 24 | 24 |
| 25 explicit ResizeArea(ResizeAreaDelegate* delegate); | 25 explicit ResizeArea(ResizeAreaDelegate* delegate); |
| 26 virtual ~ResizeArea(); | 26 virtual ~ResizeArea(); |
| 27 | 27 |
| 28 // Overridden from views::View: | 28 // Overridden from views::View: |
| 29 virtual const char* GetClassName() const OVERRIDE; | 29 virtual const char* GetClassName() const override; |
| 30 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) OVERRIDE; | 30 virtual gfx::NativeCursor GetCursor(const ui::MouseEvent& event) override; |
| 31 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 31 virtual bool OnMousePressed(const ui::MouseEvent& event) override; |
| 32 virtual bool OnMouseDragged(const ui::MouseEvent& event) OVERRIDE; | 32 virtual bool OnMouseDragged(const ui::MouseEvent& event) override; |
| 33 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 33 virtual void OnMouseReleased(const ui::MouseEvent& event) override; |
| 34 virtual void OnMouseCaptureLost() OVERRIDE; | 34 virtual void OnMouseCaptureLost() override; |
| 35 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 35 virtual void GetAccessibleState(ui::AXViewState* state) override; |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 // Report the amount the user resized by to the delegate, accounting for | 38 // Report the amount the user resized by to the delegate, accounting for |
| 39 // directionality. | 39 // directionality. |
| 40 void ReportResizeAmount(int resize_amount, bool last_update); | 40 void ReportResizeAmount(int resize_amount, bool last_update); |
| 41 | 41 |
| 42 // The delegate to notify when we have updates. | 42 // The delegate to notify when we have updates. |
| 43 ResizeAreaDelegate* delegate_; | 43 ResizeAreaDelegate* delegate_; |
| 44 | 44 |
| 45 // The mouse position at start (in screen coordinates). | 45 // The mouse position at start (in screen coordinates). |
| 46 int initial_position_; | 46 int initial_position_; |
| 47 | 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(ResizeArea); | 48 DISALLOW_COPY_AND_ASSIGN(ResizeArea); |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace views | 51 } // namespace views |
| 52 | 52 |
| 53 #endif // UI_VIEWS_CONTROLS_RESIZE_AREA_H_ | 53 #endif // UI_VIEWS_CONTROLS_RESIZE_AREA_H_ |
| OLD | NEW |