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

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

Issue 795233004: aria-pressed on a button should expose checked on android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: updating aria-button epxectations Created 6 years 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 | « no previous file | content/test/data/accessibility/aria-button-expected-android.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 GetRole() == ui::AX_ROLE_MENU_ITEM_RADIO || 126 GetRole() == ui::AX_ROLE_MENU_ITEM_RADIO ||
127 is_aria_pressed_defined) { 127 is_aria_pressed_defined) {
128 checkable = true; 128 checkable = true;
129 } 129 }
130 if (HasState(ui::AX_STATE_CHECKED)) 130 if (HasState(ui::AX_STATE_CHECKED))
131 checkable = true; 131 checkable = true;
132 return checkable; 132 return checkable;
133 } 133 }
134 134
135 bool BrowserAccessibilityAndroid::IsChecked() const { 135 bool BrowserAccessibilityAndroid::IsChecked() const {
136 return HasState(ui::AX_STATE_CHECKED); 136 return (HasState(ui::AX_STATE_CHECKED) || HasState(ui::AX_STATE_PRESSED));
137 } 137 }
138 138
139 bool BrowserAccessibilityAndroid::IsClickable() const { 139 bool BrowserAccessibilityAndroid::IsClickable() const {
140 return (PlatformIsLeaf() && !GetText().empty()); 140 return (PlatformIsLeaf() && !GetText().empty());
141 } 141 }
142 142
143 bool BrowserAccessibilityAndroid::IsCollection() const { 143 bool BrowserAccessibilityAndroid::IsCollection() const {
144 return (GetRole() == ui::AX_ROLE_GRID || 144 return (GetRole() == ui::AX_ROLE_GRID ||
145 GetRole() == ui::AX_ROLE_LIST || 145 GetRole() == ui::AX_ROLE_LIST ||
146 GetRole() == ui::AX_ROLE_LIST_BOX || 146 GetRole() == ui::AX_ROLE_LIST_BOX ||
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after
858 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { 858 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const {
859 int count = 0; 859 int count = 0;
860 for (uint32 i = 0; i < PlatformChildCount(); i++) { 860 for (uint32 i = 0; i < PlatformChildCount(); i++) {
861 if (PlatformGetChild(i)->GetRole() == role) 861 if (PlatformGetChild(i)->GetRole() == role)
862 count++; 862 count++;
863 } 863 }
864 return count; 864 return count;
865 } 865 }
866 866
867 } // namespace content 867 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/test/data/accessibility/aria-button-expected-android.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698