OLD | NEW |
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 Loading... |
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_LINE_BREAK: |
54 case ui::AX_ROLE_SLIDER: | 55 case ui::AX_ROLE_SLIDER: |
55 case ui::AX_ROLE_STATIC_TEXT: | 56 case ui::AX_ROLE_STATIC_TEXT: |
56 case ui::AX_ROLE_TEXT_AREA: | 57 case ui::AX_ROLE_TEXT_AREA: |
57 case ui::AX_ROLE_TEXT_FIELD: | 58 case ui::AX_ROLE_TEXT_FIELD: |
58 return true; | 59 return true; |
59 default: | 60 default: |
60 return false; | 61 return false; |
61 } | 62 } |
62 } | 63 } |
63 | 64 |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
710 if (GetRole() == ui::AX_ROLE_STATIC_TEXT) | 711 if (GetRole() == ui::AX_ROLE_STATIC_TEXT) |
711 return static_cast<int>(GetStringAttribute(ui::AX_ATTR_VALUE).size()); | 712 return static_cast<int>(GetStringAttribute(ui::AX_ATTR_VALUE).size()); |
712 | 713 |
713 int len = 0; | 714 int len = 0; |
714 for (size_t i = 0; i < InternalChildCount(); ++i) | 715 for (size_t i = 0; i < InternalChildCount(); ++i) |
715 len += InternalGetChild(i)->GetStaticTextLenRecursive(); | 716 len += InternalGetChild(i)->GetStaticTextLenRecursive(); |
716 return len; | 717 return len; |
717 } | 718 } |
718 | 719 |
719 } // namespace content | 720 } // namespace content |
OLD | NEW |