diff options
-rw-r--r-- | views/controls/button/radio_button.cc | 12 | ||||
-rw-r--r-- | views/controls/button/radio_button.h | 2 |
2 files changed, 6 insertions, 8 deletions
diff --git a/views/controls/button/radio_button.cc b/views/controls/button/radio_button.cc index 3f4820d..744dbe1 100644 --- a/views/controls/button/radio_button.cc +++ b/views/controls/button/radio_button.cc @@ -4,6 +4,7 @@ #include "views/controls/button/radio_button.h" +#include "base/logging.h" #include "views/widget/root_view.h" namespace views { @@ -14,12 +15,6 @@ const char RadioButton::kViewClassName[] = "views/RadioButton"; //////////////////////////////////////////////////////////////////////////////// // RadioButton, public: -RadioButton::RadioButton() : Checkbox() { -} - -RadioButton::RadioButton(const std::wstring& label) : Checkbox(label) { -} - RadioButton::RadioButton(const std::wstring& label, int group_id) : Checkbox(label) { SetGroup(group_id); @@ -47,6 +42,11 @@ void RadioButton::SetChecked(bool checked) { std::vector<View*>::iterator i; for (i = other.begin(); i != other.end(); ++i) { if (*i != this) { + if ((*i)->GetClassName() != kViewClassName) { + NOTREACHED() << "radio-button has same group as other non " + "radio-button views."; + continue; + } RadioButton* peer = static_cast<RadioButton*>(*i); peer->SetChecked(false); } diff --git a/views/controls/button/radio_button.h b/views/controls/button/radio_button.h index ab7fbe2..9a7d82e 100644 --- a/views/controls/button/radio_button.h +++ b/views/controls/button/radio_button.h @@ -15,8 +15,6 @@ class RadioButton : public Checkbox { // The button's class name. static const char kViewClassName[]; - RadioButton(); - RadioButton(const std::wstring& label); RadioButton(const std::wstring& label, int group_id); virtual ~RadioButton(); |