diff options
author | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-09 04:00:49 +0000 |
---|---|---|
committer | mhm@chromium.org <mhm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-09 04:00:49 +0000 |
commit | 70d38b09d6f504b6a47b4d0e8f0a9b2f5d615373 (patch) | |
tree | efcc27929e40b9e71d0284d8094dab970945214d /views/controls/button | |
parent | 7f265f9db6a502cb8909636d350afd0dbf6c5539 (diff) | |
download | chromium_src-70d38b09d6f504b6a47b4d0e8f0a9b2f5d615373.zip chromium_src-70d38b09d6f504b6a47b4d0e8f0a9b2f5d615373.tar.gz chromium_src-70d38b09d6f504b6a47b4d0e8f0a9b2f5d615373.tar.bz2 |
[accessibility] Allow views to have multiple accessibility states and add correct roles.
Allow views to contain multiple accessibility states since states are not mutually exclusive, we treat them as an uint32. Add missing roles to couple of views.
BUG=None
TEST=Run unit tests, and check accessibility tree.
Review URL: http://codereview.chromium.org/1527019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44054 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/button')
-rw-r--r-- | views/controls/button/checkbox.cc | 7 | ||||
-rw-r--r-- | views/controls/button/checkbox.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc index 3b0b804..1fcbea3 100644 --- a/views/controls/button/checkbox.cc +++ b/views/controls/button/checkbox.cc @@ -160,6 +160,13 @@ bool Checkbox::GetAccessibleRole(AccessibilityTypes::Role* role) { return true; } +bool Checkbox::GetAccessibleState(AccessibilityTypes::State* state) { + DCHECK(state); + + *state = checked() ? AccessibilityTypes::STATE_CHECKED : 0; + return true; +} + std::string Checkbox::GetClassName() const { return kViewClassName; } diff --git a/views/controls/button/checkbox.h b/views/controls/button/checkbox.h index a579628..bea240a 100644 --- a/views/controls/button/checkbox.h +++ b/views/controls/button/checkbox.h @@ -59,6 +59,7 @@ class Checkbox : public NativeButton { // Accessibility accessors, overridden from View. virtual bool GetAccessibleRole(AccessibilityTypes::Role* role); + virtual bool GetAccessibleState(AccessibilityTypes::State* state); // Overridden from NativeButton: virtual void SetLabel(const std::wstring& label); |