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

Unified Diff: ui/views/controls/button/checkbox.cc

Issue 2694903010: AX checked state changes (Closed)
Patch Set: Test checkbox attribute in automation API, fix whitespace, remove change to third party code Created 3 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: ui/views/controls/button/checkbox.cc
diff --git a/ui/views/controls/button/checkbox.cc b/ui/views/controls/button/checkbox.cc
index 7d933e14ad9aa34a57125ed2a31c79a48e7fc50f..81d641c805a1bf885aff74be3d621a313d905c71 100644
--- a/ui/views/controls/button/checkbox.cc
+++ b/ui/views/controls/button/checkbox.cc
@@ -111,8 +111,9 @@ const char* Checkbox::GetClassName() const {
void Checkbox::GetAccessibleNodeData(ui::AXNodeData* node_data) {
LabelButton::GetAccessibleNodeData(node_data);
node_data->role = ui::AX_ROLE_CHECK_BOX;
- if (checked())
- node_data->AddStateFlag(ui::AX_STATE_CHECKED);
+ const int checkedState =
+ checked() ? ui::AX_CHECKED_STATE_TRUE : ui::AX_CHECKED_STATE_FALSE;
+ node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, checkedState);
if (enabled()) {
if (checked()) {
node_data->AddIntAttribute(ui::AX_ATTR_ACTION,

Powered by Google App Engine
This is Rietveld 408576698