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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <iterator> | 10 #include <iterator> |
(...skipping 1005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1016 } | 1016 } |
1017 } | 1017 } |
1018 | 1018 |
1019 // Indicates if this object is at the root of a rich edit text control. | 1019 // Indicates if this object is at the root of a rich edit text control. |
1020 bool BrowserAccessibility::IsRichTextControl() const { | 1020 bool BrowserAccessibility::IsRichTextControl() const { |
1021 return HasState(ui::AX_STATE_RICHLY_EDITABLE) && | 1021 return HasState(ui::AX_STATE_RICHLY_EDITABLE) && |
1022 (!PlatformGetParent() || | 1022 (!PlatformGetParent() || |
1023 !PlatformGetParent()->HasState(ui::AX_STATE_RICHLY_EDITABLE)); | 1023 !PlatformGetParent()->HasState(ui::AX_STATE_RICHLY_EDITABLE)); |
1024 } | 1024 } |
1025 | 1025 |
| 1026 bool BrowserAccessibility::HasExplicitlyEmptyName() const { |
| 1027 return GetIntAttribute(ui::AX_ATTR_NAME_FROM) == |
| 1028 ui::AX_NAME_FROM_EXPLICITLY_EMPTY_ATTRIBUTE; |
| 1029 } |
| 1030 |
1026 std::string BrowserAccessibility::ComputeAccessibleNameFromDescendants() { | 1031 std::string BrowserAccessibility::ComputeAccessibleNameFromDescendants() { |
1027 std::string name; | 1032 std::string name; |
1028 for (size_t i = 0; i < InternalChildCount(); ++i) { | 1033 for (size_t i = 0; i < InternalChildCount(); ++i) { |
1029 BrowserAccessibility* child = InternalGetChild(i); | 1034 BrowserAccessibility* child = InternalGetChild(i); |
1030 std::string child_name; | 1035 std::string child_name; |
1031 if (child->GetStringAttribute(ui::AX_ATTR_NAME, &child_name)) { | 1036 if (child->GetStringAttribute(ui::AX_ATTR_NAME, &child_name)) { |
1032 if (!name.empty()) | 1037 if (!name.empty()) |
1033 name += " "; | 1038 name += " "; |
1034 name += child_name; | 1039 name += child_name; |
1035 } else if (!child->HasState(ui::AX_STATE_FOCUSABLE)) { | 1040 } else if (!child->HasState(ui::AX_STATE_FOCUSABLE)) { |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1189 return gfx::kNullAcceleratedWidget; | 1194 return gfx::kNullAcceleratedWidget; |
1190 } | 1195 } |
1191 | 1196 |
1192 bool BrowserAccessibility::AccessibilityPerformAction( | 1197 bool BrowserAccessibility::AccessibilityPerformAction( |
1193 const ui::AXActionData& data) { | 1198 const ui::AXActionData& data) { |
1194 NOTREACHED(); | 1199 NOTREACHED(); |
1195 return false; | 1200 return false; |
1196 } | 1201 } |
1197 | 1202 |
1198 } // namespace content | 1203 } // namespace content |
OLD | NEW |