OLD | NEW |
1 // Copyright (c) 2010 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 VIEWS_CONTROLS_RESIZE_AREA_H_ | 5 #ifndef VIEWS_CONTROLS_RESIZE_AREA_H_ |
6 #define VIEWS_CONTROLS_RESIZE_AREA_H_ | 6 #define VIEWS_CONTROLS_RESIZE_AREA_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "views/view.h" | 11 #include "views/view.h" |
(...skipping 27 matching lines...) Expand all Loading... |
39 | 39 |
40 explicit ResizeArea(ResizeAreaDelegate* delegate); | 40 explicit ResizeArea(ResizeAreaDelegate* delegate); |
41 virtual ~ResizeArea(); | 41 virtual ~ResizeArea(); |
42 | 42 |
43 // Overridden from views::View: | 43 // Overridden from views::View: |
44 virtual std::string GetClassName() const OVERRIDE; | 44 virtual std::string GetClassName() const OVERRIDE; |
45 virtual gfx::NativeCursor GetCursorForPoint(ui::EventType event_type, | 45 virtual gfx::NativeCursor GetCursorForPoint(ui::EventType event_type, |
46 const gfx::Point& p) OVERRIDE; | 46 const gfx::Point& p) OVERRIDE; |
47 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; | 47 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; |
48 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; | 48 virtual bool OnMouseDragged(const views::MouseEvent& event) OVERRIDE; |
49 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled) | 49 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; |
50 OVERRIDE; | 50 virtual void OnMouseCaptureLost() OVERRIDE; |
51 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 51 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
52 | 52 |
53 private: | 53 private: |
54 // Report the amount the user resized by to the delegate, accounting for | 54 // Report the amount the user resized by to the delegate, accounting for |
55 // directionality. | 55 // directionality. |
56 void ReportResizeAmount(int resize_amount, bool last_update); | 56 void ReportResizeAmount(int resize_amount, bool last_update); |
57 | 57 |
58 // The delegate to notify when we have updates. | 58 // The delegate to notify when we have updates. |
59 ResizeAreaDelegate* delegate_; | 59 ResizeAreaDelegate* delegate_; |
60 | 60 |
61 // The mouse position at start (in screen coordinates). | 61 // The mouse position at start (in screen coordinates). |
62 int initial_position_; | 62 int initial_position_; |
63 | 63 |
64 DISALLOW_COPY_AND_ASSIGN(ResizeArea); | 64 DISALLOW_COPY_AND_ASSIGN(ResizeArea); |
65 }; | 65 }; |
66 | 66 |
67 } // namespace views | 67 } // namespace views |
68 | 68 |
69 #endif // VIEWS_CONTROLS_RESIZE_AREA_H_ | 69 #endif // VIEWS_CONTROLS_RESIZE_AREA_H_ |
OLD | NEW |