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

Side by Side Diff: ui/views/controls/menu/menu_item_view.cc

Issue 2694903010: AX checked state changes (Closed)
Patch Set: git cl try Created 3 years, 8 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
« no previous file with comments | « ui/views/controls/button/toggle_button.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } else { 167 } else {
168 item_text = title_; 168 item_text = title_;
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 const bool is_checked = GetDelegate()->IsItemChecked(GetCommand());
179 node_data->AddStateFlag(ui::AX_STATE_CHECKED); 179 const ui::AXCheckedState checked_state =
180 break; 180 is_checked ? ui::AX_CHECKED_STATE_TRUE : ui::AX_CHECKED_STATE_FALSE;
181 node_data->AddIntAttribute(ui::AX_ATTR_CHECKED_STATE, checked_state);
182 } break;
181 case NORMAL: 183 case NORMAL:
182 case SEPARATOR: 184 case SEPARATOR:
183 case EMPTY: 185 case EMPTY:
184 // No additional accessibility states currently for these menu states. 186 // No additional accessibility states currently for these menu states.
185 break; 187 break;
186 } 188 }
187 } 189 }
188 190
189 // static 191 // static
190 bool MenuItemView::IsBubble(MenuAnchorPosition anchor) { 192 bool MenuItemView::IsBubble(MenuAnchorPosition anchor) {
(...skipping 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
1066 } else { 1068 } else {
1067 const Type& type = menu_item->GetType(); 1069 const Type& type = menu_item->GetType();
1068 if (type == CHECKBOX || type == RADIO) 1070 if (type == CHECKBOX || type == RADIO)
1069 return true; 1071 return true;
1070 } 1072 }
1071 } 1073 }
1072 return false; 1074 return false;
1073 } 1075 }
1074 1076
1075 } // namespace views 1077 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/button/toggle_button.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698