| 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 | 7 |
| 8 #include "views/view.h" | 8 #include "views/view.h" |
| 9 | 9 |
| 10 namespace views { | 10 namespace views { |
| 11 | 11 |
| 12 class Button; | 12 class Button; |
| 13 class Event; | 13 class Event; |
| 14 | 14 |
| 15 // An interface implemented by an object to let it know that a button was | 15 // An interface implemented by an object to let it know that a button was |
| 16 // pressed. | 16 // pressed. |
| 17 class ButtonListener { | 17 class ButtonListener { |
| 18 public: | 18 public: |
| 19 virtual void ButtonPressed(Button* sender, const views::Event& event) = 0; | 19 virtual void ButtonPressed(Button* sender, const views::Event& event) = 0; |
| 20 |
| 21 protected: |
| 22 virtual ~ButtonListener() {} |
| 20 }; | 23 }; |
| 21 | 24 |
| 22 // A View representing a button. Depending on the specific type, the button | 25 // A View representing a button. Depending on the specific type, the button |
| 23 // could be implemented by a native control or custom rendered. | 26 // could be implemented by a native control or custom rendered. |
| 24 class Button : public View { | 27 class Button : public View { |
| 25 public: | 28 public: |
| 26 virtual ~Button(); | 29 virtual ~Button(); |
| 27 | 30 |
| 28 void SetTooltipText(const std::wstring& tooltip_text); | 31 void SetTooltipText(const std::wstring& tooltip_text); |
| 29 | 32 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 67 |
| 65 // Event flags present when the button was clicked. | 68 // Event flags present when the button was clicked. |
| 66 int mouse_event_flags_; | 69 int mouse_event_flags_; |
| 67 | 70 |
| 68 DISALLOW_COPY_AND_ASSIGN(Button); | 71 DISALLOW_COPY_AND_ASSIGN(Button); |
| 69 }; | 72 }; |
| 70 | 73 |
| 71 } // namespace views | 74 } // namespace views |
| 72 | 75 |
| 73 #endif // VIEWS_CONTROLS_BUTTON_BUTTON_H_ | 76 #endif // VIEWS_CONTROLS_BUTTON_BUTTON_H_ |
| OLD | NEW |