| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_GRIPPER_H_ | 5 #ifndef VIEWS_CONTROLS_RESIZE_GRIPPER_H_ |
| 6 #define VIEWS_CONTROLS_RESIZE_GRIPPER_H_ | 6 #define VIEWS_CONTROLS_RESIZE_GRIPPER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "views/controls/image_view.h" | 10 #include "views/controls/image_view.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 explicit ResizeGripper(ResizeGripperDelegate* delegate); | 37 explicit ResizeGripper(ResizeGripperDelegate* delegate); |
| 38 virtual ~ResizeGripper(); | 38 virtual ~ResizeGripper(); |
| 39 | 39 |
| 40 // Overridden from views::View: | 40 // Overridden from views::View: |
| 41 virtual std::string GetClassName() const; | 41 virtual std::string GetClassName() const; |
| 42 virtual gfx::NativeCursor GetCursorForPoint(Event::EventType event_type, | 42 virtual gfx::NativeCursor GetCursorForPoint(Event::EventType event_type, |
| 43 const gfx::Point& p); | 43 const gfx::Point& p); |
| 44 virtual bool OnMousePressed(const views::MouseEvent& event); | 44 virtual bool OnMousePressed(const views::MouseEvent& event); |
| 45 virtual bool OnMouseDragged(const views::MouseEvent& event); | 45 virtual bool OnMouseDragged(const views::MouseEvent& event); |
| 46 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); | 46 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); |
| 47 virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); |
| 48 virtual bool GetAccessibleName(std::wstring* name); |
| 49 virtual void SetAccessibleName(const std::wstring& name); |
| 47 | 50 |
| 48 static const char kViewClassName[]; | 51 static const char kViewClassName[]; |
| 49 | 52 |
| 50 private: | 53 private: |
| 51 // 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 |
| 52 // directionality. | 55 // directionality. |
| 53 void ReportResizeAmount(int resize_amount, bool last_update); | 56 void ReportResizeAmount(int resize_amount, bool last_update); |
| 54 | 57 |
| 55 // The delegate to notify when we have updates. | 58 // The delegate to notify when we have updates. |
| 56 ResizeGripperDelegate* delegate_; | 59 ResizeGripperDelegate* delegate_; |
| 57 | 60 |
| 58 // The mouse position at start (in screen coordinates). | 61 // The mouse position at start (in screen coordinates). |
| 59 int initial_position_; | 62 int initial_position_; |
| 60 | 63 |
| 64 // The storage string for the accessibility name associated with this control. |
| 65 std::wstring accessible_name_; |
| 66 |
| 61 DISALLOW_COPY_AND_ASSIGN(ResizeGripper); | 67 DISALLOW_COPY_AND_ASSIGN(ResizeGripper); |
| 62 }; | 68 }; |
| 63 | 69 |
| 64 } // namespace views | 70 } // namespace views |
| 65 | 71 |
| 66 #endif // VIEWS_CONTROLS_RESIZE_GRIPPER_H_ | 72 #endif // VIEWS_CONTROLS_RESIZE_GRIPPER_H_ |
| OLD | NEW |