| OLD | NEW |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COM_WIN_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COM_WIN_H_ |
| 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COM_WIN_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COM_WIN_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlcom.h> | 9 #include <atlcom.h> |
| 10 #include <oleacc.h> | 10 #include <oleacc.h> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "ui/accessibility/platform/ax_platform_node_delegate.h" | 27 #include "ui/accessibility/platform/ax_platform_node_delegate.h" |
| 28 #include "ui/accessibility/platform/ax_platform_node_win.h" | 28 #include "ui/accessibility/platform/ax_platform_node_win.h" |
| 29 | 29 |
| 30 namespace ui { | 30 namespace ui { |
| 31 enum TextBoundaryDirection; | 31 enum TextBoundaryDirection; |
| 32 enum TextBoundaryType; | 32 enum TextBoundaryType; |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace content { | 35 namespace content { |
| 36 class BrowserAccessibilityWin; | 36 class BrowserAccessibilityWin; |
| 37 class BrowserAccessibilityRelation; | |
| 38 | 37 |
| 39 //////////////////////////////////////////////////////////////////////////////// | 38 //////////////////////////////////////////////////////////////////////////////// |
| 40 // | 39 // |
| 41 // BrowserAccessibilityComWin | 40 // BrowserAccessibilityComWin |
| 42 // | 41 // |
| 43 // Class implementing the windows accessible interface used by screen readers | 42 // Class implementing the windows accessible interface used by screen readers |
| 44 // and other assistive technology (AT). It typically is created and owned by | 43 // and other assistive technology (AT). It typically is created and owned by |
| 45 // a BrowserAccessibilityWin |owner_|. When this owner goes away, the | 44 // a BrowserAccessibilityWin |owner_|. When this owner goes away, the |
| 46 // BrowserAccessibilityComWin objects may continue to exists being held onto by | 45 // BrowserAccessibilityComWin objects may continue to exists being held onto by |
| 47 // MSCOM (due to reference counting). However, such objects are invalid and | 46 // MSCOM (due to reference counting). However, such objects are invalid and |
| (...skipping 723 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 771 | 770 |
| 772 // ID refers to the node ID in the current tree, not the globally unique ID. | 771 // ID refers to the node ID in the current tree, not the globally unique ID. |
| 773 // TODO(nektar): Could we use globally unique IDs everywhere? | 772 // TODO(nektar): Could we use globally unique IDs everywhere? |
| 774 // TODO(nektar): Rename this function to GetFromNodeID. | 773 // TODO(nektar): Rename this function to GetFromNodeID. |
| 775 BrowserAccessibilityComWin* GetFromID(int32_t id) const; | 774 BrowserAccessibilityComWin* GetFromID(int32_t id) const; |
| 776 | 775 |
| 777 // Returns true if this is a list box option with a parent of type list box, | 776 // Returns true if this is a list box option with a parent of type list box, |
| 778 // or a menu list option with a parent of type menu list popup. | 777 // or a menu list option with a parent of type menu list popup. |
| 779 bool IsListBoxOptionOrMenuListOption(); | 778 bool IsListBoxOptionOrMenuListOption(); |
| 780 | 779 |
| 781 // For adding / removing IA2 relations. | |
| 782 | |
| 783 void AddRelation(const base::string16& relation_type, int target_id); | |
| 784 void AddBidirectionalRelations(const base::string16& relation_type, | |
| 785 const base::string16& reverse_relation_type, | |
| 786 ui::AXIntListAttribute attribute); | |
| 787 void AddBidirectionalRelations(const base::string16& relation_type, | |
| 788 const base::string16& reverse_relation_type, | |
| 789 const std::vector<int32_t>& target_ids); | |
| 790 // Clears all the forward relations from this object to any other object and | |
| 791 // the associated reverse relations on the other objects, but leaves any | |
| 792 // reverse relations on this object alone. | |
| 793 void ClearOwnRelations(); | |
| 794 void RemoveBidirectionalRelationsOfType( | |
| 795 const base::string16& relation_type, | |
| 796 const base::string16& reverse_relation_type); | |
| 797 void RemoveTargetFromRelation(const base::string16& relation_type, | |
| 798 int target_id); | |
| 799 | |
| 800 // Fire a Windows-specific accessibility event notification on this node. | 780 // Fire a Windows-specific accessibility event notification on this node. |
| 801 void FireNativeEvent(LONG win_event_type) const; | 781 void FireNativeEvent(LONG win_event_type) const; |
| 802 struct WinAttributes { | 782 struct WinAttributes { |
| 803 WinAttributes(); | 783 WinAttributes(); |
| 804 ~WinAttributes(); | 784 ~WinAttributes(); |
| 805 | 785 |
| 806 // IAccessible role and state. | 786 // IAccessible role and state. |
| 807 int32_t ia_role; | 787 int32_t ia_role; |
| 808 int32_t ia_state; | 788 int32_t ia_state; |
| 809 base::string16 role_name; | 789 base::string16 role_name; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 838 }; | 818 }; |
| 839 | 819 |
| 840 BrowserAccessibilityWin* owner_; | 820 BrowserAccessibilityWin* owner_; |
| 841 | 821 |
| 842 std::unique_ptr<WinAttributes> win_attributes_; | 822 std::unique_ptr<WinAttributes> win_attributes_; |
| 843 | 823 |
| 844 // Only valid during the scope of a IA2_EVENT_TEXT_REMOVED or | 824 // Only valid during the scope of a IA2_EVENT_TEXT_REMOVED or |
| 845 // IA2_EVENT_TEXT_INSERTED event. | 825 // IA2_EVENT_TEXT_INSERTED event. |
| 846 std::unique_ptr<WinAttributes> old_win_attributes_; | 826 std::unique_ptr<WinAttributes> old_win_attributes_; |
| 847 | 827 |
| 848 // Relationships between this node and other nodes. | |
| 849 std::vector<BrowserAccessibilityRelation*> relations_; | |
| 850 | |
| 851 // The previous scroll position, so we can tell if this object scrolled. | 828 // The previous scroll position, so we can tell if this object scrolled. |
| 852 int previous_scroll_x_; | 829 int previous_scroll_x_; |
| 853 int previous_scroll_y_; | 830 int previous_scroll_y_; |
| 854 | 831 |
| 855 // Give BrowserAccessibility::Create access to our constructor. | 832 // Give BrowserAccessibility::Create access to our constructor. |
| 856 friend class BrowserAccessibility; | 833 friend class BrowserAccessibility; |
| 857 friend class BrowserAccessibilityWin; | 834 friend class BrowserAccessibilityWin; |
| 858 friend class BrowserAccessibilityRelation; | |
| 859 | 835 |
| 860 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityComWin); | 836 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityComWin); |
| 861 }; | 837 }; |
| 862 | 838 |
| 863 CONTENT_EXPORT BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( | 839 CONTENT_EXPORT BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( |
| 864 BrowserAccessibility* obj); | 840 BrowserAccessibility* obj); |
| 865 | 841 |
| 866 } // namespace content | 842 } // namespace content |
| 867 | 843 |
| 868 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COM_WIN_H_ | 844 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COM_WIN_H_ |
| OLD | NEW |