| 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 "base/i18n/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 ui::AXViewState state; | 161 ui::AXViewState state; |
| 162 child->GetAccessibleState(&state); | 162 child->GetAccessibleState(&state); |
| 163 item_text = state.name; | 163 item_text = state.name; |
| 164 } else { | 164 } else { |
| 165 item_text = title_; | 165 item_text = title_; |
| 166 } | 166 } |
| 167 state->name = GetAccessibleNameForMenuItem(item_text, GetMinorText()); | 167 state->name = GetAccessibleNameForMenuItem(item_text, GetMinorText()); |
| 168 | 168 |
| 169 switch (GetType()) { | 169 switch (GetType()) { |
| 170 case SUBMENU: | 170 case SUBMENU: |
| 171 state->state |= ui::AX_STATE_HASPOPUP; | 171 state->SetStateFlag(ui::AX_STATE_HASPOPUP); |
| 172 break; | 172 break; |
| 173 case CHECKBOX: | 173 case CHECKBOX: |
| 174 case RADIO: | 174 case RADIO: |
| 175 state->state |= GetDelegate()->IsItemChecked(GetCommand()) ? | 175 if (GetDelegate()->IsItemChecked(GetCommand())) |
| 176 ui::AX_STATE_CHECKED : 0; | 176 state->SetStateFlag(ui::AX_STATE_CHECKED); |
| 177 break; | 177 break; |
| 178 case NORMAL: | 178 case NORMAL: |
| 179 case SEPARATOR: | 179 case SEPARATOR: |
| 180 case EMPTY: | 180 case EMPTY: |
| 181 // No additional accessibility states currently for these menu states. | 181 // No additional accessibility states currently for these menu states. |
| 182 break; | 182 break; |
| 183 } | 183 } |
| 184 } | 184 } |
| 185 | 185 |
| 186 // static | 186 // static |
| (...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 } else { | 1060 } else { |
| 1061 const Type& type = menu_item->GetType(); | 1061 const Type& type = menu_item->GetType(); |
| 1062 if (type == CHECKBOX || type == RADIO) | 1062 if (type == CHECKBOX || type == RADIO) |
| 1063 return true; | 1063 return true; |
| 1064 } | 1064 } |
| 1065 } | 1065 } |
| 1066 return false; | 1066 return false; |
| 1067 } | 1067 } |
| 1068 | 1068 |
| 1069 } // namespace views | 1069 } // namespace views |
| OLD | NEW |