OLD | NEW |
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/menu/menu_item_view.h" | 5 #include "ui/views/controls/menu/menu_item_view.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 169 } |
170 node_data->SetName(GetAccessibleNameForMenuItem(item_text, GetMinorText())); | 170 node_data->SetName(GetAccessibleNameForMenuItem(item_text, GetMinorText())); |
171 | 171 |
172 switch (GetType()) { | 172 switch (GetType()) { |
173 case SUBMENU: | 173 case SUBMENU: |
174 node_data->AddStateFlag(ui::AX_STATE_HASPOPUP); | 174 node_data->AddStateFlag(ui::AX_STATE_HASPOPUP); |
175 break; | 175 break; |
176 case CHECKBOX: | 176 case CHECKBOX: |
177 case RADIO: | 177 case RADIO: |
178 if (GetDelegate()->IsItemChecked(GetCommand())) | 178 if (GetDelegate()->IsItemChecked(GetCommand())) |
179 node_data->AddStateFlag(ui::AX_STATE_CHECKED); | 179 node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, |
| 180 ui::AX_CHECKED_STATE_FALSE); |
180 break; | 181 break; |
181 case NORMAL: | 182 case NORMAL: |
182 case SEPARATOR: | 183 case SEPARATOR: |
183 case EMPTY: | 184 case EMPTY: |
184 // No additional accessibility states currently for these menu states. | 185 // No additional accessibility states currently for these menu states. |
185 break; | 186 break; |
186 } | 187 } |
187 } | 188 } |
188 | 189 |
189 // static | 190 // static |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1066 } else { | 1067 } else { |
1067 const Type& type = menu_item->GetType(); | 1068 const Type& type = menu_item->GetType(); |
1068 if (type == CHECKBOX || type == RADIO) | 1069 if (type == CHECKBOX || type == RADIO) |
1069 return true; | 1070 return true; |
1070 } | 1071 } |
1071 } | 1072 } |
1072 return false; | 1073 return false; |
1073 } | 1074 } |
1074 | 1075 |
1075 } // namespace views | 1076 } // namespace views |
OLD | NEW |