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

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

Issue 2319903003: Don't expose Android set selection accessibility action for empty text fields (Closed)
Patch Set: Update one test expectation Created 4 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/i18n/break_iterator.h" 7 #include "base/i18n/break_iterator.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
1336 for (uint32_t i = 0; i < InternalChildCount(); i++) { 1336 for (uint32_t i = 0; i < InternalChildCount(); i++) {
1337 BrowserAccessibility* child = InternalGetChild(i); 1337 BrowserAccessibility* child = InternalGetChild(i);
1338 if (child->HasState(ui::AX_STATE_FOCUSABLE)) 1338 if (child->HasState(ui::AX_STATE_FOCUSABLE))
1339 return true; 1339 return true;
1340 if (static_cast<BrowserAccessibilityAndroid*>(child)->HasFocusableChild()) 1340 if (static_cast<BrowserAccessibilityAndroid*>(child)->HasFocusableChild())
1341 return true; 1341 return true;
1342 } 1342 }
1343 return false; 1343 return false;
1344 } 1344 }
1345 1345
1346 bool BrowserAccessibilityAndroid::HasNonEmptyValue() const {
1347 return IsEditableText() && !GetValue().empty();
1348 }
1349
1346 bool BrowserAccessibilityAndroid::HasOnlyTextChildren() const { 1350 bool BrowserAccessibilityAndroid::HasOnlyTextChildren() const {
1347 // This is called from PlatformIsLeaf, so don't call PlatformChildCount 1351 // This is called from PlatformIsLeaf, so don't call PlatformChildCount
1348 // from within this! 1352 // from within this!
1349 for (uint32_t i = 0; i < InternalChildCount(); i++) { 1353 for (uint32_t i = 0; i < InternalChildCount(); i++) {
1350 BrowserAccessibility* child = InternalGetChild(i); 1354 BrowserAccessibility* child = InternalGetChild(i);
1351 if (!child->IsTextOnlyObject()) 1355 if (!child->IsTextOnlyObject())
1352 return false; 1356 return false;
1353 } 1357 }
1354 return true; 1358 return true;
1355 } 1359 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1420 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { 1424 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const {
1421 int count = 0; 1425 int count = 0;
1422 for (uint32_t i = 0; i < PlatformChildCount(); i++) { 1426 for (uint32_t i = 0; i < PlatformChildCount(); i++) {
1423 if (PlatformGetChild(i)->GetRole() == role) 1427 if (PlatformGetChild(i)->GetRole() == role)
1424 count++; 1428 count++;
1425 } 1429 }
1426 return count; 1430 return count;
1427 } 1431 }
1428 1432
1429 } // namespace content 1433 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698