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

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

Issue 844273002: Add option to not dump childrens of a node in AX Tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | content/browser/accessibility/dump_accessibility_tree_browsertest.cc » ('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 (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 "content/browser/accessibility/browser_accessibility.h" 5 #include "content/browser/accessibility/browser_accessibility.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.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/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 bool BrowserAccessibility::PlatformIsLeaf() const { 46 bool BrowserAccessibility::PlatformIsLeaf() const {
47 if (InternalChildCount() == 0) 47 if (InternalChildCount() == 0)
48 return true; 48 return true;
49 49
50 // All of these roles may have children that we use as internal 50 // All of these roles may have children that we use as internal
51 // implementation details, but we want to expose them as leaves 51 // implementation details, but we want to expose them as leaves
52 // to platform accessibility APIs. 52 // to platform accessibility APIs.
53 switch (GetRole()) { 53 switch (GetRole()) {
54 case ui::AX_ROLE_DATE:
dmazzoni 2015/01/13 22:34:49 Making the change here will actually make these co
55 case ui::AX_ROLE_DATE_TIME:
54 case ui::AX_ROLE_LINE_BREAK: 56 case ui::AX_ROLE_LINE_BREAK:
55 case ui::AX_ROLE_SLIDER: 57 case ui::AX_ROLE_SLIDER:
56 case ui::AX_ROLE_STATIC_TEXT: 58 case ui::AX_ROLE_STATIC_TEXT:
59 case ui::AX_ROLE_TIME:
57 case ui::AX_ROLE_TEXT_AREA: 60 case ui::AX_ROLE_TEXT_AREA:
58 case ui::AX_ROLE_TEXT_FIELD: 61 case ui::AX_ROLE_TEXT_FIELD:
59 return true; 62 return true;
60 default: 63 default:
61 return false; 64 return false;
62 } 65 }
63 } 66 }
64 67
65 uint32 BrowserAccessibility::PlatformChildCount() const { 68 uint32 BrowserAccessibility::PlatformChildCount() const {
66 return PlatformIsLeaf() ? 0 : InternalChildCount(); 69 return PlatformIsLeaf() ? 0 : InternalChildCount();
(...skipping 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 if (GetRole() == ui::AX_ROLE_STATIC_TEXT) 714 if (GetRole() == ui::AX_ROLE_STATIC_TEXT)
712 return static_cast<int>(GetStringAttribute(ui::AX_ATTR_VALUE).size()); 715 return static_cast<int>(GetStringAttribute(ui::AX_ATTR_VALUE).size());
713 716
714 int len = 0; 717 int len = 0;
715 for (size_t i = 0; i < InternalChildCount(); ++i) 718 for (size_t i = 0; i < InternalChildCount(); ++i)
716 len += InternalGetChild(i)->GetStaticTextLenRecursive(); 719 len += InternalGetChild(i)->GetStaticTextLenRecursive();
717 return len; 720 return len;
718 } 721 }
719 722
720 } // namespace content 723 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/accessibility/dump_accessibility_tree_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698