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_BUTTON_BUTTON_H_ | 5 #ifndef VIEWS_CONTROLS_BUTTON_BUTTON_H_ |
6 #define VIEWS_CONTROLS_BUTTON_BUTTON_H_ | 6 #define VIEWS_CONTROLS_BUTTON_BUTTON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "views/view.h" | 9 #include "views/view.h" |
10 | 10 |
(...skipping 21 matching lines...) Expand all Loading... |
32 void SetTooltipText(const std::wstring& tooltip_text); | 32 void SetTooltipText(const std::wstring& tooltip_text); |
33 | 33 |
34 int tag() const { return tag_; } | 34 int tag() const { return tag_; } |
35 void set_tag(int tag) { tag_ = tag; } | 35 void set_tag(int tag) { tag_ = tag; } |
36 | 36 |
37 int mouse_event_flags() const { return mouse_event_flags_; } | 37 int mouse_event_flags() const { return mouse_event_flags_; } |
38 | 38 |
39 void SetAccessibleKeyboardShortcut(const std::wstring& shortcut); | 39 void SetAccessibleKeyboardShortcut(const std::wstring& shortcut); |
40 | 40 |
41 // Overridden from View: | 41 // Overridden from View: |
42 virtual bool GetTooltipText(const gfx::Point& p, std::wstring* tooltip); | 42 virtual bool GetTooltipText(const gfx::Point& p, |
43 virtual std::wstring GetAccessibleKeyboardShortcut(); | 43 std::wstring* tooltip) OVERRIDE; |
44 virtual AccessibilityTypes::Role GetAccessibleRole(); | 44 virtual string16 GetAccessibleKeyboardShortcut() OVERRIDE; |
| 45 virtual AccessibilityTypes::Role GetAccessibleRole() OVERRIDE; |
45 | 46 |
46 protected: | 47 protected: |
47 // Construct the Button with a Listener. The listener can be NULL. This can be | 48 // Construct the Button with a Listener. The listener can be NULL. This can be |
48 // true of buttons that don't have a listener - e.g. menubuttons where there's | 49 // true of buttons that don't have a listener - e.g. menubuttons where there's |
49 // no default action and checkboxes. | 50 // no default action and checkboxes. |
50 explicit Button(ButtonListener* listener); | 51 explicit Button(ButtonListener* listener); |
51 | 52 |
52 // Cause the button to notify the listener that a click occurred. | 53 // Cause the button to notify the listener that a click occurred. |
53 virtual void NotifyClick(const views::Event& event); | 54 virtual void NotifyClick(const views::Event& event); |
54 | 55 |
(...skipping 13 matching lines...) Expand all Loading... |
68 | 69 |
69 // Event flags present when the button was clicked. | 70 // Event flags present when the button was clicked. |
70 int mouse_event_flags_; | 71 int mouse_event_flags_; |
71 | 72 |
72 DISALLOW_COPY_AND_ASSIGN(Button); | 73 DISALLOW_COPY_AND_ASSIGN(Button); |
73 }; | 74 }; |
74 | 75 |
75 } // namespace views | 76 } // namespace views |
76 | 77 |
77 #endif // VIEWS_CONTROLS_BUTTON_BUTTON_H_ | 78 #endif // VIEWS_CONTROLS_BUTTON_BUTTON_H_ |
OLD | NEW |