OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ASH_SYSTEM_USER_BUTTON_FROM_VIEW_H_ | 5 #ifndef ASH_SYSTEM_USER_BUTTON_FROM_VIEW_H_ |
6 #define ASH_SYSTEM_USER_BUTTON_FROM_VIEW_H_ | 6 #define ASH_SYSTEM_USER_BUTTON_FROM_VIEW_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "ui/gfx/insets.h" | 9 #include "ui/gfx/insets.h" |
10 #include "ui/views/controls/button/custom_button.h" | 10 #include "ui/views/controls/button/custom_button.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 ButtonFromView(views::View* content, | 24 ButtonFromView(views::View* content, |
25 views::ButtonListener* listener, | 25 views::ButtonListener* listener, |
26 bool highlight_on_hover, | 26 bool highlight_on_hover, |
27 const gfx::Insets& tab_frame_inset); | 27 const gfx::Insets& tab_frame_inset); |
28 virtual ~ButtonFromView(); | 28 virtual ~ButtonFromView(); |
29 | 29 |
30 // Called when the border should remain even in the non highlighted state. | 30 // Called when the border should remain even in the non highlighted state. |
31 void ForceBorderVisible(bool show); | 31 void ForceBorderVisible(bool show); |
32 | 32 |
33 // Overridden from views::View | 33 // Overridden from views::View |
34 virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; | 34 virtual void OnMouseEntered(const ui::MouseEvent& event) override; |
35 virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; | 35 virtual void OnMouseExited(const ui::MouseEvent& event) override; |
36 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 36 virtual void OnPaint(gfx::Canvas* canvas) override; |
37 virtual void OnFocus() OVERRIDE; | 37 virtual void OnFocus() override; |
38 virtual void OnBlur() OVERRIDE; | 38 virtual void OnBlur() override; |
39 | 39 |
40 // Check if the item is hovered. | 40 // Check if the item is hovered. |
41 bool is_hovered_for_test() { return button_hovered_; } | 41 bool is_hovered_for_test() { return button_hovered_; } |
42 | 42 |
43 private: | 43 private: |
44 // Change the hover/active state of the "button" when the status changes. | 44 // Change the hover/active state of the "button" when the status changes. |
45 void ShowActive(); | 45 void ShowActive(); |
46 | 46 |
47 // Content of button. | 47 // Content of button. |
48 views::View* content_; | 48 views::View* content_; |
(...skipping 10 matching lines...) Expand all Loading... |
59 // The insets which get used for the drawn accessibility (tab) frame. | 59 // The insets which get used for the drawn accessibility (tab) frame. |
60 gfx::Insets tab_frame_inset_; | 60 gfx::Insets tab_frame_inset_; |
61 | 61 |
62 DISALLOW_COPY_AND_ASSIGN(ButtonFromView); | 62 DISALLOW_COPY_AND_ASSIGN(ButtonFromView); |
63 }; | 63 }; |
64 | 64 |
65 } // namespace tray | 65 } // namespace tray |
66 } // namespace ash | 66 } // namespace ash |
67 | 67 |
68 #endif // ASH_SYSTEM_USER_BUTTON_FROM_VIEW_H_ | 68 #endif // ASH_SYSTEM_USER_BUTTON_FROM_VIEW_H_ |
OLD | NEW |