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

Side by Side 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 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 return ui::MaterialDesignController::IsSecondaryUiMaterial(); 104 return ui::MaterialDesignController::IsSecondaryUiMaterial();
105 } 105 }
106 106
107 const char* Checkbox::GetClassName() const { 107 const char* Checkbox::GetClassName() const {
108 return kViewClassName; 108 return kViewClassName;
109 } 109 }
110 110
111 void Checkbox::GetAccessibleNodeData(ui::AXNodeData* node_data) { 111 void Checkbox::GetAccessibleNodeData(ui::AXNodeData* node_data) {
112 LabelButton::GetAccessibleNodeData(node_data); 112 LabelButton::GetAccessibleNodeData(node_data);
113 node_data->role = ui::AX_ROLE_CHECK_BOX; 113 node_data->role = ui::AX_ROLE_CHECK_BOX;
114 if (checked()) 114 const int checkedState =
115 node_data->AddStateFlag(ui::AX_STATE_CHECKED); 115 checked() ? ui::AX_CHECKED_STATE_TRUE : ui::AX_CHECKED_STATE_FALSE;
116 node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, checkedState);
116 if (enabled()) { 117 if (enabled()) {
117 if (checked()) { 118 if (checked()) {
118 node_data->AddIntAttribute(ui::AX_ATTR_ACTION, 119 node_data->AddIntAttribute(ui::AX_ATTR_ACTION,
119 ui::AX_SUPPORTED_ACTION_UNCHECK); 120 ui::AX_SUPPORTED_ACTION_UNCHECK);
120 } else { 121 } else {
121 node_data->AddIntAttribute(ui::AX_ATTR_ACTION, 122 node_data->AddIntAttribute(ui::AX_ATTR_ACTION,
122 ui::AX_SUPPORTED_ACTION_CHECK); 123 ui::AX_SUPPORTED_ACTION_CHECK);
123 } 124 }
124 } 125 }
125 } 126 }
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 ui::NativeTheme::Part Checkbox::GetThemePart() const { 221 ui::NativeTheme::Part Checkbox::GetThemePart() const {
221 return ui::NativeTheme::kCheckbox; 222 return ui::NativeTheme::kCheckbox;
222 } 223 }
223 224
224 void Checkbox::GetExtraParams(ui::NativeTheme::ExtraParams* params) const { 225 void Checkbox::GetExtraParams(ui::NativeTheme::ExtraParams* params) const {
225 LabelButton::GetExtraParams(params); 226 LabelButton::GetExtraParams(params);
226 params->button.checked = checked_; 227 params->button.checked = checked_;
227 } 228 }
228 229
229 } // namespace views 230 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698