diff options
author | ctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-10 18:34:03 +0000 |
---|---|---|
committer | ctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-10 18:34:03 +0000 |
commit | 4abaee203b9d0dfe8c2fb84682a564fe995b3c79 (patch) | |
tree | 7cc0237dfa00cbc87e6d769449c0e073cdc64a62 /views/controls/button/checkbox.cc | |
parent | 6e64343accab0d5b5436645e40a36f5ff20d17ec (diff) | |
download | chromium_src-4abaee203b9d0dfe8c2fb84682a564fe995b3c79.zip chromium_src-4abaee203b9d0dfe8c2fb84682a564fe995b3c79.tar.gz chromium_src-4abaee203b9d0dfe8c2fb84682a564fe995b3c79.tar.bz2 |
Landing tfarina CL.
Original patch by thiago.farina@gmail.com
See original review at:
http://codereview.chromium.org/668225/show
BUG=9616
TEST=opens AccExplorer2, opens clear browsing data, select the a checkbox+label with the AccExplorer2 tool,
see if the role for this control is checkbox.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41178 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/button/checkbox.cc')
-rw-r--r-- | views/controls/button/checkbox.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/views/controls/button/checkbox.cc b/views/controls/button/checkbox.cc index f4594be..1dcb80a 100644 --- a/views/controls/button/checkbox.cc +++ b/views/controls/button/checkbox.cc @@ -5,6 +5,7 @@ #include "views/controls/button/checkbox.h" #include "app/gfx/canvas.h" +#include "base/logging.h" #include "views/controls/label.h" namespace views { @@ -152,6 +153,19 @@ void Checkbox::WillLoseFocus() { label_->set_paint_as_focused(false); } +bool Checkbox::GetAccessibleRole(AccessibilityTypes::Role* role) { + DCHECK(role); + + *role = AccessibilityTypes::ROLE_CHECKBUTTON; + return true; +} + +bool Checkbox::GetAccessibleName(std::wstring* name) { + DCHECK(name); + *name = label_->GetText(); + return !name->empty(); +} + std::string Checkbox::GetClassName() const { return kViewClassName; } |