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

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

Issue 2518183002: Moved action verbs out of Blink. (Closed)
Patch Set: Only enabled buttons should expose the press action. Created 4 years, 1 month 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 f07b748488138b6cb4e1f5c5f9a3acb576ac8e03..3cf1bfb2f6c5b4962023f4d0370d0a90972e99f6 100644
--- a/ui/views/controls/button/checkbox.cc
+++ b/ui/views/controls/button/checkbox.cc
@@ -123,8 +123,14 @@ 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())
+ if (checked()) {
node_data->AddStateFlag(ui::AX_STATE_CHECKED);
+ node_data->AddIntAttribute(ui::AX_ATTR_ACTION,
sky 2016/11/28 22:32:00 Shouldn't the check/uncheck only be added if enabl
+ ui::AX_SUPPORTED_ACTION_UNCHECK);
+ } else {
+ node_data->AddIntAttribute(ui::AX_ATTR_ACTION,
+ ui::AX_SUPPORTED_ACTION_CHECK);
+ }
}
void Checkbox::OnPaint(gfx::Canvas* canvas) {

Powered by Google App Engine
This is Rietveld 408576698