Chromium Code Reviews| 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/native_theme/native_theme.h" |
| 9 #include "ui/views/view.h" | 9 #include "ui/views/view.h" |
| 10 | 10 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 | 62 |
| 63 protected: | 63 protected: |
| 64 // Construct the Button with a Listener. The listener can be NULL. This can be | 64 // Construct the Button with a Listener. The listener can be NULL. This can be |
| 65 // true of buttons that don't have a listener - e.g. menubuttons where there's | 65 // true of buttons that don't have a listener - e.g. menubuttons where there's |
| 66 // no default action and checkboxes. | 66 // no default action and checkboxes. |
| 67 explicit Button(ButtonListener* listener); | 67 explicit Button(ButtonListener* listener); |
| 68 | 68 |
| 69 // Cause the button to notify the listener that a click occurred. | 69 // Cause the button to notify the listener that a click occurred. |
| 70 virtual void NotifyClick(const ui::Event& event); | 70 virtual void NotifyClick(const ui::Event& event); |
| 71 | 71 |
| 72 // Called when a button gets released without triggering an action. | |
|
bruthig
2015/10/22 15:18:50
I think you should be explicit here about this onl
varkha
2015/10/23 15:49:46
Done.
| |
| 73 virtual void NotifyReleasedWithoutClick(const ui::Event& event); | |
| 74 | |
| 72 // The button's listener. Notified when clicked. | 75 // The button's listener. Notified when clicked. |
| 73 ButtonListener* listener_; | 76 ButtonListener* listener_; |
| 74 | 77 |
| 75 private: | 78 private: |
| 76 // The text shown in a tooltip. | 79 // The text shown in a tooltip. |
| 77 base::string16 tooltip_text_; | 80 base::string16 tooltip_text_; |
| 78 | 81 |
| 79 // Accessibility data. | 82 // Accessibility data. |
| 80 base::string16 accessible_name_; | 83 base::string16 accessible_name_; |
| 81 | 84 |
| 82 // The id tag associated with this button. Used to disambiguate buttons in | 85 // The id tag associated with this button. Used to disambiguate buttons in |
| 83 // the ButtonListener implementation. | 86 // the ButtonListener implementation. |
| 84 int tag_; | 87 int tag_; |
| 85 | 88 |
| 86 DISALLOW_COPY_AND_ASSIGN(Button); | 89 DISALLOW_COPY_AND_ASSIGN(Button); |
| 87 }; | 90 }; |
| 88 | 91 |
| 89 } // namespace views | 92 } // namespace views |
| 90 | 93 |
| 91 #endif // UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ | 94 #endif // UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ |
| OLD | NEW |