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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 bool BrowserAccessibility::HasState(ui::AXState state_enum) const { | 660 bool BrowserAccessibility::HasState(ui::AXState state_enum) const { |
661 return (GetState() >> state_enum) & 1; | 661 return (GetState() >> state_enum) & 1; |
662 } | 662 } |
663 | 663 |
664 bool BrowserAccessibility::IsCellOrTableHeaderRole() const { | 664 bool BrowserAccessibility::IsCellOrTableHeaderRole() const { |
665 return (GetRole() == ui::AX_ROLE_CELL || | 665 return (GetRole() == ui::AX_ROLE_CELL || |
666 GetRole() == ui::AX_ROLE_COLUMN_HEADER || | 666 GetRole() == ui::AX_ROLE_COLUMN_HEADER || |
667 GetRole() == ui::AX_ROLE_ROW_HEADER); | 667 GetRole() == ui::AX_ROLE_ROW_HEADER); |
668 } | 668 } |
669 | 669 |
| 670 bool BrowserAccessibility::IsTableOrGridOrTreeGridRole() const { |
| 671 return (GetRole() == ui::AX_ROLE_TABLE || |
| 672 GetRole() == ui::AX_ROLE_GRID || |
| 673 GetRole() == ui::AX_ROLE_TREE_GRID); |
| 674 } |
| 675 |
670 bool BrowserAccessibility::HasCaret() const { | 676 bool BrowserAccessibility::HasCaret() const { |
671 if (IsEditableText() && !HasState(ui::AX_STATE_RICHLY_EDITABLE) && | 677 if (IsEditableText() && !HasState(ui::AX_STATE_RICHLY_EDITABLE) && |
672 HasIntAttribute(ui::AX_ATTR_TEXT_SEL_START) && | 678 HasIntAttribute(ui::AX_ATTR_TEXT_SEL_START) && |
673 HasIntAttribute(ui::AX_ATTR_TEXT_SEL_END)) { | 679 HasIntAttribute(ui::AX_ATTR_TEXT_SEL_END)) { |
674 return true; | 680 return true; |
675 } | 681 } |
676 | 682 |
677 // The caret is always at the focus of the selection. | 683 // The caret is always at the focus of the selection. |
678 int32 focus_id = manager()->GetTreeData().sel_focus_object_id; | 684 int32 focus_id = manager()->GetTreeData().sel_focus_object_id; |
679 BrowserAccessibility* focus_object = manager()->GetFromID(focus_id); | 685 BrowserAccessibility* focus_object = manager()->GetFromID(focus_id); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
854 } | 860 } |
855 need_to_offset_web_area = true; | 861 need_to_offset_web_area = true; |
856 } | 862 } |
857 parent = parent->GetParent(); | 863 parent = parent->GetParent(); |
858 } | 864 } |
859 | 865 |
860 return bounds; | 866 return bounds; |
861 } | 867 } |
862 | 868 |
863 } // namespace content | 869 } // namespace content |
OLD | NEW |