summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/controls/button/native_button_win.cc3
-rw-r--r--chrome/views/controls/button/native_button_win.h4
2 files changed, 6 insertions, 1 deletions
diff --git a/chrome/views/controls/button/native_button_win.cc b/chrome/views/controls/button/native_button_win.cc
index a6cf075..5a254ac 100644
--- a/chrome/views/controls/button/native_button_win.cc
+++ b/chrome/views/controls/button/native_button_win.cc
@@ -160,7 +160,8 @@ bool NativeCheckboxWin::OnKeyDown(int vkey) {
bool NativeCheckboxWin::ProcessMessage(UINT message, WPARAM w_param,
LPARAM l_param, LRESULT* result) {
if (message == WM_COMMAND && HIWORD(w_param) == BN_CLICKED) {
- checkbox_->SetChecked(!checkbox_->checked());
+ if (!IsRadioButton() || !checkbox_->checked())
+ checkbox_->SetChecked(!checkbox_->checked());
// Fall through to the NativeButtonWin's handler, which will send the
// clicked notification to the listener...
}
diff --git a/chrome/views/controls/button/native_button_win.h b/chrome/views/controls/button/native_button_win.h
index f9dbcaf..ce1cc75e 100644
--- a/chrome/views/controls/button/native_button_win.h
+++ b/chrome/views/controls/button/native_button_win.h
@@ -75,6 +75,9 @@ class NativeCheckboxWin : public NativeButtonWin {
virtual void NativeControlCreated(HWND control_hwnd);
virtual bool IsCheckbox() const { return true; }
+ // Returns true if this button is actually a radio button.
+ virtual bool IsRadioButton() const { return false; }
+
private:
// The Checkbox we are bound to.
Checkbox* checkbox_;
@@ -91,6 +94,7 @@ class NativeRadioButtonWin : public NativeCheckboxWin {
protected:
// Overridden from NativeCheckboxWin:
virtual void CreateNativeControl();
+ virtual bool IsRadioButton() const { return true; }
private:
DISALLOW_COPY_AND_ASSIGN(NativeRadioButtonWin);