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

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

Issue 92004: Fix focus rects for checkboxes and radio buttons:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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 | « chrome/views/controls/button/radio_button.h ('k') | chrome/views/controls/label.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/views/controls/button/radio_button.cc
===================================================================
--- chrome/views/controls/button/radio_button.cc (revision 14167)
+++ chrome/views/controls/button/radio_button.cc (working copy)
@@ -81,13 +81,14 @@
return false;
}
-void RadioButton::OnMouseReleased(const views::MouseEvent& event,
- bool canceled) {
+void RadioButton::OnMouseReleased(const MouseEvent& event, bool canceled) {
native_wrapper_->SetPushed(false);
- // Call through to toggle the button only if we're not already checked, since
- // radio buttons can't be toggled like checkboxes.
- if (!checked())
- Checkbox::OnMouseReleased(event, canceled);
+ // 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))
+ SetChecked(true);
+
+ ButtonPressed();
}
std::string RadioButton::GetClassName() const {
« no previous file with comments | « chrome/views/controls/button/radio_button.h ('k') | chrome/views/controls/label.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698