summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authormhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-23 23:36:14 +0000
committermhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-23 23:36:14 +0000
commit475b996b15bd1010869876e6d70e4c79bc1fea05 (patch)
tree606feda4aff84bb7f6bf8d07ba9f95dc24795087 /views
parent9190b7b454dfda0980bc7652e9cb62ace614f6cf (diff)
downloadchromium_src-475b996b15bd1010869876e6d70e4c79bc1fea05.zip
chromium_src-475b996b15bd1010869876e6d70e4c79bc1fea05.tar.gz
chromium_src-475b996b15bd1010869876e6d70e4c79bc1fea05.tar.bz2
Add Accessibility name for native buttons.
Remove the accessible name from Checkbox since it inherits from NativeButton. Dialogs with autogenerated buttons now have MSAA name attached to it, as well as all the checkboxes. BUG=38987 TEST=Ran it in AccExplorer Review URL: http://codereview.chromium.org/1102006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42401 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/button/checkbox.cc6
-rw-r--r--views/controls/button/checkbox.h1
-rw-r--r--views/controls/button/native_button.cc3
3 files changed, 3 insertions, 7 deletions
diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc
index f1ae320..65981a4 100644
--- a/views/controls/button/checkbox.cc
+++ b/views/controls/button/checkbox.cc
@@ -160,12 +160,6 @@ bool Checkbox::GetAccessibleRole(AccessibilityTypes::Role* role) {
return true;
}
-bool Checkbox::GetAccessibleName(std::wstring* name) {
- DCHECK(name);
- *name = label_->GetText();
- return !name->empty();
-}
-
std::string Checkbox::GetClassName() const {
return kViewClassName;
}
diff --git a/views/controls/button/checkbox.h b/views/controls/button/checkbox.h
index dc58117..a579628 100644
--- a/views/controls/button/checkbox.h
+++ b/views/controls/button/checkbox.h
@@ -59,7 +59,6 @@ class Checkbox : public NativeButton {
// Accessibility accessors, overridden from View.
virtual bool GetAccessibleRole(AccessibilityTypes::Role* role);
- virtual bool GetAccessibleName(std::wstring* name);
// Overridden from NativeButton:
virtual void SetLabel(const std::wstring& label);
diff --git a/views/controls/button/native_button.cc b/views/controls/button/native_button.cc
index 7086008..5ff98e8 100644
--- a/views/controls/button/native_button.cc
+++ b/views/controls/button/native_button.cc
@@ -79,6 +79,9 @@ void NativeButton::SetLabel(const std::wstring& label) {
if (native_wrapper_)
native_wrapper_->UpdateLabel();
+
+ // Update the accessible name whenever the label changes.
+ SetAccessibleName(label);
}
void NativeButton::SetIsDefault(bool is_default) {