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