summaryrefslogtreecommitdiffstats
path: root/views/controls/button/radio_button.cc
diff options
context:
space:
mode:
authormsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-29 00:39:05 +0000
committermsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-29 00:39:05 +0000
commit34338254f776be94d79ca184c4eb2ea5b3f62318 (patch)
treea20d913935cfe06590e6a39808234774e35e3ff8 /views/controls/button/radio_button.cc
parent7bd801611073a0e79a011a96ec72cb201656344a (diff)
downloadchromium_src-34338254f776be94d79ca184c4eb2ea5b3f62318.zip
chromium_src-34338254f776be94d79ca184c4eb2ea5b3f62318.tar.gz
chromium_src-34338254f776be94d79ca184c4eb2ea5b3f62318.tar.bz2
Disambiguate OnMouseCaptureLost from OnMouseReleased.
Nix RenderWidgetHostViewViews' OnMouseCaptureLost forwarding. Consolidate code, remove unnecessary overrides, etc. Fix up test, |event| args, OVERRIDEs, and (c) dates. BUG=72040 TEST=Views mouse button release, cancelling mouse down/drag. Review URL: http://codereview.chromium.org/6685069 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79640 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/button/radio_button.cc')
-rw-r--r--views/controls/button/radio_button.cc12
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();
}