diff options
author | dtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-24 23:20:08 +0000 |
---|---|---|
committer | dtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-24 23:20:08 +0000 |
commit | 8ab402196ee4dc510e0162010789d43b96b54243 (patch) | |
tree | ee061500a2a3cacd6f6fb9419e4fb2a6f5f4e39e /views/controls | |
parent | 01b12ba89a6117a849ac2537d58991c76f2f2da2 (diff) | |
download | chromium_src-8ab402196ee4dc510e0162010789d43b96b54243.zip chromium_src-8ab402196ee4dc510e0162010789d43b96b54243.tar.gz chromium_src-8ab402196ee4dc510e0162010789d43b96b54243.tar.bz2 |
Fix radiobuttons and connect up child widgets again.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/2806030
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50778 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r-- | views/controls/button/radio_button.cc | 7 | ||||
-rw-r--r-- | views/controls/button/radio_button.h | 3 | ||||
-rw-r--r-- | views/controls/native_control_win.cc | 6 |
3 files changed, 14 insertions, 2 deletions
diff --git a/views/controls/button/radio_button.cc b/views/controls/button/radio_button.cc index 45e3da7..d7953e1 100644 --- a/views/controls/button/radio_button.cc +++ b/views/controls/button/radio_button.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this +// Copyright (c) 2010 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. @@ -60,6 +60,11 @@ void RadioButton::SetChecked(bool checked) { //////////////////////////////////////////////////////////////////////////////// // RadioButton, View overrides: +bool RadioButton::GetAccessibleRole(AccessibilityTypes::Role* role) { + *role = AccessibilityTypes::ROLE_RADIOBUTTON; + return true; +} + View* RadioButton::GetSelectedViewForGroup(int group_id) { std::vector<View*> views; GetRootView()->GetViewsWithGroup(group_id, &views); diff --git a/views/controls/button/radio_button.h b/views/controls/button/radio_button.h index 3882ec2..980395f 100644 --- a/views/controls/button/radio_button.h +++ b/views/controls/button/radio_button.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this +// Copyright (c) 2010 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. @@ -24,6 +24,7 @@ class RadioButton : public Checkbox { virtual void SetChecked(bool checked); // Overridden from View: + virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); virtual View* GetSelectedViewForGroup(int group_id); virtual bool IsGroupFocusTraversable() const; virtual void OnMouseReleased(const MouseEvent& event, bool canceled); diff --git a/views/controls/native_control_win.cc b/views/controls/native_control_win.cc index c73d17c..217fee1 100644 --- a/views/controls/native_control_win.cc +++ b/views/controls/native_control_win.cc @@ -92,6 +92,12 @@ void NativeControlWin::VisibilityChanged(View* starting_from, bool is_visible) { void NativeControlWin::Focus() { DCHECK(native_view()); SetFocus(native_view()); + + // Since we are being wrapped by a view, accessibility should receive + // the super class as the focused view. + View* parent_view = GetParent(); + if (parent_view->HasFocus()) + parent_view->NotifyAccessibilityEvent(AccessibilityTypes::EVENT_FOCUS); } //////////////////////////////////////////////////////////////////////////////// |