diff options
Diffstat (limited to 'views/controls/button/radio_button.cc')
-rw-r--r-- | views/controls/button/radio_button.cc | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/views/controls/button/radio_button.cc b/views/controls/button/radio_button.cc index f162f2c..46133be 100644 --- a/views/controls/button/radio_button.cc +++ b/views/controls/button/radio_button.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -87,13 +87,17 @@ bool RadioButton::IsGroupFocusTraversable() const { return false; } -void RadioButton::OnMouseReleased(const MouseEvent& event, bool canceled) { - native_wrapper_->SetPushed(false); +void RadioButton::OnMouseReleased(const MouseEvent& event) { // Set the checked state to true only if we are unchecked, since we can't // be toggled on and off like a checkbox. - if (!checked() && !canceled && HitTestLabel(event)) + if (!checked() && HitTestLabel(event)) SetChecked(true); + OnMouseCaptureLost(); +} + +void RadioButton::OnMouseCaptureLost() { + native_wrapper_->SetPushed(false); ButtonPressed(); } |