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

Side by Side Diff: ui/views/controls/button/checkbox.cc

Issue 2694903010: AX checked state changes (Closed)
Patch Set: Fix compiler error 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/controls/button/checkbox.h" 5 #include "ui/views/controls/button/checkbox.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 } 117 }
118 118
119 const char* Checkbox::GetClassName() const { 119 const char* Checkbox::GetClassName() const {
120 return kViewClassName; 120 return kViewClassName;
121 } 121 }
122 122
123 void Checkbox::GetAccessibleNodeData(ui::AXNodeData* node_data) { 123 void Checkbox::GetAccessibleNodeData(ui::AXNodeData* node_data) {
124 LabelButton::GetAccessibleNodeData(node_data); 124 LabelButton::GetAccessibleNodeData(node_data);
125 node_data->role = ui::AX_ROLE_CHECK_BOX; 125 node_data->role = ui::AX_ROLE_CHECK_BOX;
126 if (checked()) 126 if (checked())
127 node_data->AddStateFlag(ui::AX_STATE_CHECKED); 127 node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE,
128 ui::AX_CHECKED_STATE_TRUE);
128 if (enabled()) { 129 if (enabled()) {
129 if (checked()) { 130 if (checked()) {
130 node_data->AddIntAttribute(ui::AX_ATTR_ACTION, 131 node_data->AddIntAttribute(ui::AX_ATTR_ACTION,
131 ui::AX_SUPPORTED_ACTION_UNCHECK); 132 ui::AX_SUPPORTED_ACTION_UNCHECK);
132 } else { 133 } else {
133 node_data->AddIntAttribute(ui::AX_ATTR_ACTION, 134 node_data->AddIntAttribute(ui::AX_ATTR_ACTION,
134 ui::AX_SUPPORTED_ACTION_CHECK); 135 ui::AX_SUPPORTED_ACTION_CHECK);
135 } 136 }
136 } 137 }
137 } 138 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 ui::NativeTheme::Part Checkbox::GetThemePart() const { 233 ui::NativeTheme::Part Checkbox::GetThemePart() const {
233 return ui::NativeTheme::kCheckbox; 234 return ui::NativeTheme::kCheckbox;
234 } 235 }
235 236
236 void Checkbox::GetExtraParams(ui::NativeTheme::ExtraParams* params) const { 237 void Checkbox::GetExtraParams(ui::NativeTheme::ExtraParams* params) const {
237 LabelButton::GetExtraParams(params); 238 LabelButton::GetExtraParams(params);
238 params->button.checked = checked_; 239 params->button.checked = checked_;
239 } 240 }
240 241
241 } // namespace views 242 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698