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

Side by Side Diff: content/browser/accessibility/browser_accessibility_android.cc

Issue 634533002: Fixing IA2 role for input type attribute in button and checkbox state with menu and aria role menu … (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 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/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "content/browser/accessibility/browser_accessibility_manager_android.h" 8 #include "content/browser/accessibility/browser_accessibility_manager_android.h"
9 #include "content/common/accessibility_messages.h" 9 #include "content/common/accessibility_messages.h"
10 10
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 bool BrowserAccessibilityAndroid::IsCheckable() const { 93 bool BrowserAccessibilityAndroid::IsCheckable() const {
94 bool checkable = false; 94 bool checkable = false;
95 bool is_aria_pressed_defined; 95 bool is_aria_pressed_defined;
96 bool is_mixed; 96 bool is_mixed;
97 GetAriaTristate("aria-pressed", &is_aria_pressed_defined, &is_mixed); 97 GetAriaTristate("aria-pressed", &is_aria_pressed_defined, &is_mixed);
98 if (GetRole() == ui::AX_ROLE_CHECK_BOX || 98 if (GetRole() == ui::AX_ROLE_CHECK_BOX ||
99 GetRole() == ui::AX_ROLE_RADIO_BUTTON || 99 GetRole() == ui::AX_ROLE_RADIO_BUTTON ||
100 GetRole() == ui::AX_ROLE_MENU_ITEM_CHECK_BOX || 100 GetRole() == ui::AX_ROLE_MENU_ITEM_CHECK_BOX ||
101 GetRole() == ui::AX_ROLE_MENU_ITEM_RADIO || 101 GetRole() == ui::AX_ROLE_MENU_ITEM_RADIO ||
102 GetRole() == ui::AX_ROLE_CHECK_BOX_MENU_ITEM ||
102 is_aria_pressed_defined) { 103 is_aria_pressed_defined) {
103 checkable = true; 104 checkable = true;
104 } 105 }
105 if (HasState(ui::AX_STATE_CHECKED)) 106 if (HasState(ui::AX_STATE_CHECKED))
106 checkable = true; 107 checkable = true;
107 return checkable; 108 return checkable;
108 } 109 }
109 110
110 bool BrowserAccessibilityAndroid::IsChecked() const { 111 bool BrowserAccessibilityAndroid::IsChecked() const {
111 return HasState(ui::AX_STATE_CHECKED); 112 return HasState(ui::AX_STATE_CHECKED);
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { 647 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const {
647 int count = 0; 648 int count = 0;
648 for (uint32 i = 0; i < PlatformChildCount(); i++) { 649 for (uint32 i = 0; i < PlatformChildCount(); i++) {
649 if (PlatformGetChild(i)->GetRole() == role) 650 if (PlatformGetChild(i)->GetRole() == role)
650 count++; 651 count++;
651 } 652 }
652 return count; 653 return count;
653 } 654 }
654 655
655 } // namespace content 656 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698