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

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 most TODOs and sync. 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
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..c139c09f5d7b21c2a03d24e52931199b00f8d6e9 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.
@@ -61,9 +61,8 @@ void RadioButton::SetChecked(bool checked) {
////////////////////////////////////////////////////////////////////////////////
// RadioButton, View overrides:
-void RadioButton::GetAccessibleState(ui::AccessibleViewState* state) {
- Checkbox::GetAccessibleState(state);
- state->role = ui::AccessibilityTypes::ROLE_RADIOBUTTON;
+std::string RadioButton::GetClassName() const {
+ return kViewClassName;
}
View* RadioButton::GetSelectedViewForGroup(int group_id) {
@@ -87,18 +86,24 @@ bool RadioButton::IsGroupFocusTraversable() const {
return false;
}
-void RadioButton::OnMouseReleased(const MouseEvent& event, bool canceled) {
+void RadioButton::OnMouseReleased(const MouseEvent& event) {
native_wrapper_->SetPushed(false);
// 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);
ButtonPressed();
}
-std::string RadioButton::GetClassName() const {
- return kViewClassName;
+void RadioButton::OnMouseCaptureLost() {
+ native_wrapper_->SetPushed(false);
+ ButtonPressed();
+}
+
+void RadioButton::GetAccessibleState(ui::AccessibleViewState* state) {
+ Checkbox::GetAccessibleState(state);
+ state->role = ui::AccessibilityTypes::ROLE_RADIOBUTTON;
}
////////////////////////////////////////////////////////////////////////////////

Powered by Google App Engine
This is Rietveld 408576698