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

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

Issue 2694903010: AX checked state changes (Closed)
Patch Set: git cl try Created 3 years, 8 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
« no previous file with comments | « ui/views/controls/button/checkbox.cc ('k') | ui/views/controls/menu/menu_item_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/toggle_button.cc
diff --git a/ui/views/controls/button/toggle_button.cc b/ui/views/controls/button/toggle_button.cc
index 45e99d69aff1ad6f2efc5a8e263d55514a2beeb2..e2ef935946e853ba0cafc4fe936ae0861bfd739e 100644
--- a/ui/views/controls/button/toggle_button.cc
+++ b/ui/views/controls/button/toggle_button.cc
@@ -233,8 +233,9 @@ void ToggleButton::GetAccessibleNodeData(ui::AXNodeData* node_data) {
CustomButton::GetAccessibleNodeData(node_data);
node_data->role = ui::AX_ROLE_SWITCH;
- if (is_on_)
- node_data->AddStateFlag(ui::AX_STATE_CHECKED);
+ const ui::AXCheckedState checked_state =
+ is_on_ ? ui::AX_CHECKED_STATE_TRUE : ui::AX_CHECKED_STATE_FALSE;
+ node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, checked_state);
}
void ToggleButton::NotifyClick(const ui::Event& event) {
« no previous file with comments | « ui/views/controls/button/checkbox.cc ('k') | ui/views/controls/menu/menu_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698