OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/browser/accessibility/browser_accessibility_android.h" | 5 #include "content/browser/accessibility/browser_accessibility_android.h" |
6 | 6 |
7 #include "base/i18n/break_iterator.h" | 7 #include "base/i18n/break_iterator.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 } | 248 } |
249 | 249 |
250 bool BrowserAccessibilityAndroid::CanOpenPopup() const { | 250 bool BrowserAccessibilityAndroid::CanOpenPopup() const { |
251 return HasState(ui::AX_STATE_HASPOPUP); | 251 return HasState(ui::AX_STATE_HASPOPUP); |
252 } | 252 } |
253 | 253 |
254 const char* BrowserAccessibilityAndroid::GetClassName() const { | 254 const char* BrowserAccessibilityAndroid::GetClassName() const { |
255 const char* class_name = NULL; | 255 const char* class_name = NULL; |
256 | 256 |
257 switch (GetRole()) { | 257 switch (GetRole()) { |
| 258 case ui::AX_ROLE_SEARCH_BOX: |
258 case ui::AX_ROLE_SPIN_BUTTON: | 259 case ui::AX_ROLE_SPIN_BUTTON: |
259 case ui::AX_ROLE_TEXT_AREA: | 260 case ui::AX_ROLE_TEXT_AREA: |
260 case ui::AX_ROLE_TEXT_FIELD: | 261 case ui::AX_ROLE_TEXT_FIELD: |
261 class_name = "android.widget.EditText"; | 262 class_name = "android.widget.EditText"; |
262 break; | 263 break; |
263 case ui::AX_ROLE_SLIDER: | 264 case ui::AX_ROLE_SLIDER: |
264 class_name = "android.widget.SeekBar"; | 265 class_name = "android.widget.SeekBar"; |
265 break; | 266 break; |
266 case ui::AX_ROLE_COLOR_WELL: | 267 case ui::AX_ROLE_COLOR_WELL: |
267 case ui::AX_ROLE_COMBO_BOX: | 268 case ui::AX_ROLE_COMBO_BOX: |
268 case ui::AX_ROLE_DATE: | 269 case ui::AX_ROLE_DATE: |
269 case ui::AX_ROLE_POP_UP_BUTTON: | 270 case ui::AX_ROLE_POP_UP_BUTTON: |
270 case ui::AX_ROLE_TIME: | 271 case ui::AX_ROLE_TIME: |
271 class_name = "android.widget.Spinner"; | 272 class_name = "android.widget.Spinner"; |
272 break; | 273 break; |
273 case ui::AX_ROLE_BUTTON: | 274 case ui::AX_ROLE_BUTTON: |
274 case ui::AX_ROLE_MENU_BUTTON: | 275 case ui::AX_ROLE_MENU_BUTTON: |
275 class_name = "android.widget.Button"; | 276 class_name = "android.widget.Button"; |
276 break; | 277 break; |
277 case ui::AX_ROLE_CHECK_BOX: | 278 case ui::AX_ROLE_CHECK_BOX: |
| 279 case ui::AX_ROLE_SWITCH: |
278 class_name = "android.widget.CheckBox"; | 280 class_name = "android.widget.CheckBox"; |
279 break; | 281 break; |
280 case ui::AX_ROLE_RADIO_BUTTON: | 282 case ui::AX_ROLE_RADIO_BUTTON: |
281 class_name = "android.widget.RadioButton"; | 283 class_name = "android.widget.RadioButton"; |
282 break; | 284 break; |
283 case ui::AX_ROLE_TOGGLE_BUTTON: | 285 case ui::AX_ROLE_TOGGLE_BUTTON: |
284 class_name = "android.widget.ToggleButton"; | 286 class_name = "android.widget.ToggleButton"; |
285 break; | 287 break; |
286 case ui::AX_ROLE_CANVAS: | 288 case ui::AX_ROLE_CANVAS: |
287 case ui::AX_ROLE_IMAGE: | 289 case ui::AX_ROLE_IMAGE: |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
877 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { | 879 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { |
878 int count = 0; | 880 int count = 0; |
879 for (uint32 i = 0; i < PlatformChildCount(); i++) { | 881 for (uint32 i = 0; i < PlatformChildCount(); i++) { |
880 if (PlatformGetChild(i)->GetRole() == role) | 882 if (PlatformGetChild(i)->GetRole() == role) |
881 count++; | 883 count++; |
882 } | 884 } |
883 return count; | 885 return count; |
884 } | 886 } |
885 | 887 |
886 } // namespace content | 888 } // namespace content |
OLD | NEW |