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 | 10 |
(...skipping 971 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
982 bool BrowserAccessibility::HasState(ui::AXState state_enum) const { | 982 bool BrowserAccessibility::HasState(ui::AXState state_enum) const { |
983 return (GetState() >> state_enum) & 1; | 983 return (GetState() >> state_enum) & 1; |
984 } | 984 } |
985 | 985 |
986 bool BrowserAccessibility::IsCellOrTableHeaderRole() const { | 986 bool BrowserAccessibility::IsCellOrTableHeaderRole() const { |
987 return (GetRole() == ui::AX_ROLE_CELL || | 987 return (GetRole() == ui::AX_ROLE_CELL || |
988 GetRole() == ui::AX_ROLE_COLUMN_HEADER || | 988 GetRole() == ui::AX_ROLE_COLUMN_HEADER || |
989 GetRole() == ui::AX_ROLE_ROW_HEADER); | 989 GetRole() == ui::AX_ROLE_ROW_HEADER); |
990 } | 990 } |
991 | 991 |
| 992 bool BrowserAccessibility::IsTableOrGridOrTreeGridRole() const { |
| 993 return (GetRole() == ui::AX_ROLE_TABLE || |
| 994 GetRole() == ui::AX_ROLE_GRID || |
| 995 GetRole() == ui::AX_ROLE_TREE_GRID); |
| 996 } |
| 997 |
992 bool BrowserAccessibility::HasCaret() const { | 998 bool BrowserAccessibility::HasCaret() const { |
993 if (IsSimpleTextControl() && HasIntAttribute(ui::AX_ATTR_TEXT_SEL_START) && | 999 if (IsSimpleTextControl() && HasIntAttribute(ui::AX_ATTR_TEXT_SEL_START) && |
994 HasIntAttribute(ui::AX_ATTR_TEXT_SEL_END)) { | 1000 HasIntAttribute(ui::AX_ATTR_TEXT_SEL_END)) { |
995 return true; | 1001 return true; |
996 } | 1002 } |
997 | 1003 |
998 // The caret is always at the focus of the selection. | 1004 // The caret is always at the focus of the selection. |
999 int32_t focus_id = manager()->GetTreeData().sel_focus_object_id; | 1005 int32_t focus_id = manager()->GetTreeData().sel_focus_object_id; |
1000 BrowserAccessibility* focus_object = manager()->GetFromID(focus_id); | 1006 BrowserAccessibility* focus_object = manager()->GetFromID(focus_id); |
1001 if (!focus_object) | 1007 if (!focus_object) |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1224 } | 1230 } |
1225 } | 1231 } |
1226 | 1232 |
1227 node = container; | 1233 node = container; |
1228 } | 1234 } |
1229 | 1235 |
1230 return gfx::ToEnclosingRect(bounds); | 1236 return gfx::ToEnclosingRect(bounds); |
1231 } | 1237 } |
1232 | 1238 |
1233 } // namespace content | 1239 } // namespace content |
OLD | NEW |