| 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_BUTTON_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ |
| 6 #define UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ |
| 7 | 7 |
| 8 #include "ui/native_theme/native_theme.h" |
| 8 #include "ui/views/view.h" | 9 #include "ui/views/view.h" |
| 9 | 10 |
| 10 namespace views { | 11 namespace views { |
| 11 | 12 |
| 12 class Button; | 13 class Button; |
| 13 class Event; | 14 class Event; |
| 14 | 15 |
| 15 // An interface implemented by an object to let it know that a button was | 16 // An interface implemented by an object to let it know that a button was |
| 16 // pressed. | 17 // pressed. |
| 17 class VIEWS_EXPORT ButtonListener { | 18 class VIEWS_EXPORT ButtonListener { |
| (...skipping 20 matching lines...) Expand all Loading... |
| 38 }; | 39 }; |
| 39 | 40 |
| 40 // Button styles with associated images and border painters. | 41 // Button styles with associated images and border painters. |
| 41 // TODO(msw): Add Menu, ComboBox, etc. | 42 // TODO(msw): Add Menu, ComboBox, etc. |
| 42 enum ButtonStyle { | 43 enum ButtonStyle { |
| 43 STYLE_BUTTON = 0, | 44 STYLE_BUTTON = 0, |
| 44 STYLE_TEXTBUTTON, | 45 STYLE_TEXTBUTTON, |
| 45 STYLE_COUNT, | 46 STYLE_COUNT, |
| 46 }; | 47 }; |
| 47 | 48 |
| 49 static ButtonState GetButtonStateFrom(ui::NativeTheme::State state); |
| 50 |
| 48 void SetTooltipText(const base::string16& tooltip_text); | 51 void SetTooltipText(const base::string16& tooltip_text); |
| 49 | 52 |
| 50 int tag() const { return tag_; } | 53 int tag() const { return tag_; } |
| 51 void set_tag(int tag) { tag_ = tag; } | 54 void set_tag(int tag) { tag_ = tag; } |
| 52 | 55 |
| 53 void SetAccessibleName(const base::string16& name); | 56 void SetAccessibleName(const base::string16& name); |
| 54 | 57 |
| 55 // Overridden from View: | 58 // Overridden from View: |
| 56 virtual bool GetTooltipText(const gfx::Point& p, | 59 virtual bool GetTooltipText(const gfx::Point& p, |
| 57 base::string16* tooltip) const OVERRIDE; | 60 base::string16* tooltip) const OVERRIDE; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 79 // The id tag associated with this button. Used to disambiguate buttons in | 82 // The id tag associated with this button. Used to disambiguate buttons in |
| 80 // the ButtonListener implementation. | 83 // the ButtonListener implementation. |
| 81 int tag_; | 84 int tag_; |
| 82 | 85 |
| 83 DISALLOW_COPY_AND_ASSIGN(Button); | 86 DISALLOW_COPY_AND_ASSIGN(Button); |
| 84 }; | 87 }; |
| 85 | 88 |
| 86 } // namespace views | 89 } // namespace views |
| 87 | 90 |
| 88 #endif // UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ | 91 #endif // UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ |
| OLD | NEW |