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

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

Issue 2518183002: Moved action verbs out of Blink. (Closed)
Patch Set: Added missing braces. Created 4 years 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/button.cc ('k') | ui/views/controls/button/custom_button.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/checkbox.cc
diff --git a/ui/views/controls/button/checkbox.cc b/ui/views/controls/button/checkbox.cc
index f07b748488138b6cb4e1f5c5f9a3acb576ac8e03..97637e3c4342d4e0ccb4719f2179016a16787db9 100644
--- a/ui/views/controls/button/checkbox.cc
+++ b/ui/views/controls/button/checkbox.cc
@@ -125,6 +125,15 @@ void Checkbox::GetAccessibleNodeData(ui::AXNodeData* node_data) {
node_data->role = ui::AX_ROLE_CHECK_BOX;
if (checked())
node_data->AddStateFlag(ui::AX_STATE_CHECKED);
+ if (enabled()) {
+ if (checked()) {
+ node_data->AddIntAttribute(ui::AX_ATTR_ACTION,
+ ui::AX_SUPPORTED_ACTION_UNCHECK);
+ } else {
+ node_data->AddIntAttribute(ui::AX_ATTR_ACTION,
+ ui::AX_SUPPORTED_ACTION_CHECK);
+ }
+ }
}
void Checkbox::OnPaint(gfx::Canvas* canvas) {
« no previous file with comments | « ui/views/controls/button/button.cc ('k') | ui/views/controls/button/custom_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698