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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
720 | 720 |
721 // Public accessors (these do not have COM accessible accessors) | 721 // Public accessors (these do not have COM accessible accessors) |
722 const base::string16& role_name() const { return win_attributes_->role_name; } | 722 const base::string16& role_name() const { return win_attributes_->role_name; } |
723 const std::map<int, std::vector<base::string16>>& offset_to_text_attributes() | 723 const std::map<int, std::vector<base::string16>>& offset_to_text_attributes() |
724 const { | 724 const { |
725 return win_attributes_->offset_to_text_attributes; | 725 return win_attributes_->offset_to_text_attributes; |
726 } | 726 } |
727 | 727 |
728 private: | 728 private: |
729 // Private accessors. | 729 // Private accessors. |
730 int32_t ia2_role() const { return win_attributes_->ia2_role; } | |
731 | |
732 const std::vector<base::string16>& ia2_attributes() const { | 730 const std::vector<base::string16>& ia2_attributes() const { |
733 return win_attributes_->ia2_attributes; | 731 return win_attributes_->ia2_attributes; |
734 } | 732 } |
735 base::string16 name() const { return win_attributes_->name; } | 733 base::string16 name() const { return win_attributes_->name; } |
736 base::string16 description() const { return win_attributes_->description; } | 734 base::string16 description() const { return win_attributes_->description; } |
737 base::string16 value() const { return win_attributes_->value; } | 735 base::string16 value() const { return win_attributes_->value; } |
738 | 736 |
739 std::map<int32_t, int32_t>& hyperlink_offset_to_index() const { | 737 std::map<int32_t, int32_t>& hyperlink_offset_to_index() const { |
740 return win_attributes_->hyperlink_offset_to_index; | 738 return win_attributes_->hyperlink_offset_to_index; |
741 } | 739 } |
(...skipping 27 matching lines...) Expand all Loading... |
769 // present. | 767 // present. |
770 std::map<int, std::vector<base::string16>> GetSpellingAttributes(); | 768 std::map<int, std::vector<base::string16>> GetSpellingAttributes(); |
771 | 769 |
772 // Many MSAA methods take a var_id parameter indicating that the operation | 770 // Many MSAA methods take a var_id parameter indicating that the operation |
773 // should be performed on a particular child ID, rather than this object. | 771 // should be performed on a particular child ID, rather than this object. |
774 // This method tries to figure out the target object from |var_id| and | 772 // This method tries to figure out the target object from |var_id| and |
775 // returns a pointer to the target object if it exists, otherwise NULL. | 773 // returns a pointer to the target object if it exists, otherwise NULL. |
776 // Does not return a new reference. | 774 // Does not return a new reference. |
777 BrowserAccessibilityComWin* GetTargetFromChildID(const VARIANT& var_id); | 775 BrowserAccessibilityComWin* GetTargetFromChildID(const VARIANT& var_id); |
778 | 776 |
779 // Initialize the role and state metadata from the role enum and state | |
780 // bitmasks defined in ui::AXNodeData. | |
781 void InitRoleAndState(); | |
782 | |
783 // Retrieve the value of an attribute from the string attribute map and | 777 // Retrieve the value of an attribute from the string attribute map and |
784 // if found and nonempty, allocate a new BSTR (with SysAllocString) | 778 // if found and nonempty, allocate a new BSTR (with SysAllocString) |
785 // and return S_OK. If not found or empty, return S_FALSE. | 779 // and return S_OK. If not found or empty, return S_FALSE. |
786 HRESULT GetStringAttributeAsBstr(ui::AXStringAttribute attribute, | 780 HRESULT GetStringAttributeAsBstr(ui::AXStringAttribute attribute, |
787 BSTR* value_bstr); | 781 BSTR* value_bstr); |
788 | 782 |
789 // Escapes characters in string attributes as required by the IA2 Spec. | 783 // Escapes characters in string attributes as required by the IA2 Spec. |
790 // It's okay for input to be the same as output. | 784 // It's okay for input to be the same as output. |
791 CONTENT_EXPORT static void SanitizeStringAttributeForIA2( | 785 CONTENT_EXPORT static void SanitizeStringAttributeForIA2( |
792 const base::string16& input, | 786 const base::string16& input, |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 | 979 |
986 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityComWin); | 980 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityComWin); |
987 }; | 981 }; |
988 | 982 |
989 CONTENT_EXPORT BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( | 983 CONTENT_EXPORT BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( |
990 BrowserAccessibility* obj); | 984 BrowserAccessibility* obj); |
991 | 985 |
992 } // namespace content | 986 } // namespace content |
993 | 987 |
994 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COM_WIN_H_ | 988 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_COM_WIN_H_ |
OLD | NEW |