Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: views/controls/button/radio_button.cc

Issue 6685069: Disambiguate OnMouseCaptureLost from OnMouseReleased, etc. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments, fix tests, cleanup, etc. Created 9 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/controls/button/radio_button.h ('k') | views/controls/link.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/button/radio_button.cc
diff --git a/views/controls/button/radio_button.cc b/views/controls/button/radio_button.cc
index f162f2c3215d467a91d990f797ec1568691681d7..46133bed52867ad68fad96f23c507fe7a74aa48e 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();
}
« no previous file with comments | « views/controls/button/radio_button.h ('k') | views/controls/link.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698