| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this |
| 2 // source code is governed by a BSD-style license that can be found in the | 2 // source code is governed by a BSD-style license that can be found in the |
| 3 // LICENSE file. | 3 // LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_VIEWS_CONTROLS_BUTTON_RADIO_BUTTON_H_ | 5 #ifndef CHROME_VIEWS_CONTROLS_BUTTON_RADIO_BUTTON_H_ |
| 6 #define CHROME_VIEWS_CONTROLS_BUTTON_RADIO_BUTTON_H_ | 6 #define CHROME_VIEWS_CONTROLS_BUTTON_RADIO_BUTTON_H_ |
| 7 | 7 |
| 8 #include "chrome/views/controls/button/checkbox.h" | 8 #include "chrome/views/controls/button/checkbox.h" |
| 9 | 9 |
| 10 namespace views { | 10 namespace views { |
| 11 | 11 |
| 12 // A Checkbox subclass representing a radio button. | 12 // A Checkbox subclass representing a radio button. |
| 13 class RadioButton : public Checkbox { | 13 class RadioButton : public Checkbox { |
| 14 public: | 14 public: |
| 15 // The button's class name. | 15 // The button's class name. |
| 16 static const char kViewClassName[]; | 16 static const char kViewClassName[]; |
| 17 | 17 |
| 18 RadioButton(); | 18 RadioButton(); |
| 19 RadioButton(const std::wstring& label); | 19 RadioButton(const std::wstring& label); |
| 20 RadioButton(const std::wstring& label, int group_id); | 20 RadioButton(const std::wstring& label, int group_id); |
| 21 virtual ~RadioButton(); | 21 virtual ~RadioButton(); |
| 22 | 22 |
| 23 // Overridden from Checkbox: | 23 // Overridden from Checkbox: |
| 24 virtual void SetChecked(bool checked); | 24 virtual void SetChecked(bool checked); |
| 25 | 25 |
| 26 // Overridden from View: | 26 // Overridden from View: |
| 27 virtual View* GetSelectedViewForGroup(int group_id); | 27 virtual View* GetSelectedViewForGroup(int group_id); |
| 28 virtual bool IsGroupFocusTraversable() const; | 28 virtual bool IsGroupFocusTraversable() const; |
| 29 virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); | 29 virtual void OnMouseReleased(const MouseEvent& event, bool canceled); |
| 30 | 30 |
| 31 protected: | 31 protected: |
| 32 virtual std::string GetClassName() const; | 32 virtual std::string GetClassName() const; |
| 33 | 33 |
| 34 // Overridden from NativeButton: | 34 // Overridden from NativeButton: |
| 35 virtual void CreateWrapper(); | 35 virtual void CreateWrapper(); |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 DISALLOW_COPY_AND_ASSIGN(RadioButton); | 38 DISALLOW_COPY_AND_ASSIGN(RadioButton); |
| 39 }; | 39 }; |
| 40 | 40 |
| 41 } // namespace views | 41 } // namespace views |
| 42 | 42 |
| 43 #endif // #ifndef CHROME_VIEWS_CONTROLS_BUTTON_RADIO_BUTTON_H_ | 43 #endif // #ifndef CHROME_VIEWS_CONTROLS_BUTTON_RADIO_BUTTON_H_ |
| OLD | NEW |