| 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 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ |
| 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <atlbase.h> | 9 #include <atlbase.h> |
| 10 #include <atlcom.h> | 10 #include <atlcom.h> |
| 11 #include <oleacc.h> | 11 #include <oleacc.h> |
| 12 #include <UIAutomationCore.h> | 12 #include <UIAutomationCore.h> |
| 13 | 13 |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
| 17 #include "content/browser/accessibility/browser_accessibility.h" | 17 #include "content/browser/accessibility/browser_accessibility.h" |
| 18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
| 19 #include "third_party/iaccessible2/ia2_api_all.h" | 19 #include "third_party/iaccessible2/ia2_api_all.h" |
| 20 #include "third_party/isimpledom/ISimpleDOMDocument.h" | 20 #include "third_party/isimpledom/ISimpleDOMDocument.h" |
| 21 #include "third_party/isimpledom/ISimpleDOMNode.h" | 21 #include "third_party/isimpledom/ISimpleDOMNode.h" |
| 22 #include "third_party/isimpledom/ISimpleDOMText.h" | 22 #include "third_party/isimpledom/ISimpleDOMText.h" |
| 23 #include "webkit/glue/webaccessibility.h" | |
| 24 | 23 |
| 25 class BrowserAccessibilityRelation; | 24 class BrowserAccessibilityRelation; |
| 26 | 25 |
| 27 namespace ui { | 26 namespace ui { |
| 28 enum TextBoundaryDirection; | 27 enum TextBoundaryDirection; |
| 29 enum TextBoundaryType; | 28 enum TextBoundaryType; |
| 30 } | 29 } |
| 31 | 30 |
| 32 using webkit_glue::WebAccessibility; | |
| 33 | |
| 34 //////////////////////////////////////////////////////////////////////////////// | 31 //////////////////////////////////////////////////////////////////////////////// |
| 35 // | 32 // |
| 36 // BrowserAccessibilityWin | 33 // BrowserAccessibilityWin |
| 37 // | 34 // |
| 38 // Class implementing the windows accessible interface for the Browser-Renderer | 35 // Class implementing the windows accessible interface for the Browser-Renderer |
| 39 // communication of accessibility information, providing accessibility | 36 // communication of accessibility information, providing accessibility |
| 40 // to be used by screen readers and other assistive technology (AT). | 37 // to be used by screen readers and other assistive technology (AT). |
| 41 // | 38 // |
| 42 //////////////////////////////////////////////////////////////////////////////// | 39 //////////////////////////////////////////////////////////////////////////////// |
| 43 class __declspec(uuid("562072fe-3390-43b1-9e2c-dd4118f5ac79")) | 40 class __declspec(uuid("562072fe-3390-43b1-9e2c-dd4118f5ac79")) |
| (...skipping 718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 BrowserAccessibilityWin* NewReference(); | 759 BrowserAccessibilityWin* NewReference(); |
| 763 | 760 |
| 764 // Many MSAA methods take a var_id parameter indicating that the operation | 761 // Many MSAA methods take a var_id parameter indicating that the operation |
| 765 // should be performed on a particular child ID, rather than this object. | 762 // should be performed on a particular child ID, rather than this object. |
| 766 // This method tries to figure out the target object from |var_id| and | 763 // This method tries to figure out the target object from |var_id| and |
| 767 // returns a pointer to the target object if it exists, otherwise NULL. | 764 // returns a pointer to the target object if it exists, otherwise NULL. |
| 768 // Does not return a new reference. | 765 // Does not return a new reference. |
| 769 BrowserAccessibilityWin* GetTargetFromChildID(const VARIANT& var_id); | 766 BrowserAccessibilityWin* GetTargetFromChildID(const VARIANT& var_id); |
| 770 | 767 |
| 771 // Initialize the role and state metadata from the role enum and state | 768 // Initialize the role and state metadata from the role enum and state |
| 772 // bitmasks defined in webkit/glue/webaccessibility.h. | 769 // bitmasks defined in AccessibilityNodeData. |
| 773 void InitRoleAndState(); | 770 void InitRoleAndState(); |
| 774 | 771 |
| 775 // Retrieve the value of an attribute from the string attribute map and | 772 // Retrieve the value of an attribute from the string attribute map and |
| 776 // if found and nonempty, allocate a new BSTR (with SysAllocString) | 773 // if found and nonempty, allocate a new BSTR (with SysAllocString) |
| 777 // and return S_OK. If not found or empty, return S_FALSE. | 774 // and return S_OK. If not found or empty, return S_FALSE. |
| 778 HRESULT GetStringAttributeAsBstr( | 775 HRESULT GetStringAttributeAsBstr( |
| 779 WebAccessibility::StringAttribute attribute, BSTR* value_bstr); | 776 content::AccessibilityNodeData::StringAttribute attribute, |
| 777 BSTR* value_bstr); |
| 780 | 778 |
| 781 // If the string attribute |attribute| is present, add its value as an | 779 // If the string attribute |attribute| is present, add its value as an |
| 782 // IAccessible2 attribute with the name |ia2_attr|. | 780 // IAccessible2 attribute with the name |ia2_attr|. |
| 783 void StringAttributeToIA2( | 781 void StringAttributeToIA2( |
| 784 WebAccessibility::StringAttribute attribute, const char* ia2_attr); | 782 content::AccessibilityNodeData::StringAttribute attribute, |
| 783 const char* ia2_attr); |
| 785 | 784 |
| 786 // If the bool attribute |attribute| is present, add its value as an | 785 // If the bool attribute |attribute| is present, add its value as an |
| 787 // IAccessible2 attribute with the name |ia2_attr|. | 786 // IAccessible2 attribute with the name |ia2_attr|. |
| 788 void BoolAttributeToIA2( | 787 void BoolAttributeToIA2( |
| 789 WebAccessibility::BoolAttribute attribute, const char* ia2_attr); | 788 content::AccessibilityNodeData::BoolAttribute attribute, |
| 789 const char* ia2_attr); |
| 790 | 790 |
| 791 // If the int attribute |attribute| is present, add its value as an | 791 // If the int attribute |attribute| is present, add its value as an |
| 792 // IAccessible2 attribute with the name |ia2_attr|. | 792 // IAccessible2 attribute with the name |ia2_attr|. |
| 793 void IntAttributeToIA2( | 793 void IntAttributeToIA2( |
| 794 WebAccessibility::IntAttribute attribute, const char* ia2_attr); | 794 content::AccessibilityNodeData::IntAttribute attribute, |
| 795 const char* ia2_attr); |
| 795 | 796 |
| 796 // Get the text of this node for the purposes of IAccessibleText - it may | 797 // Get the text of this node for the purposes of IAccessibleText - it may |
| 797 // be the name, it may be the value, etc. depending on the role. | 798 // be the name, it may be the value, etc. depending on the role. |
| 798 const string16& TextForIAccessibleText(); | 799 const string16& TextForIAccessibleText(); |
| 799 | 800 |
| 800 // If offset is a member of IA2TextSpecialOffsets this function updates the | 801 // If offset is a member of IA2TextSpecialOffsets this function updates the |
| 801 // value of offset and returns, otherwise offset remains unchanged. | 802 // value of offset and returns, otherwise offset remains unchanged. |
| 802 void HandleSpecialTextOffset(const string16& text, LONG* offset); | 803 void HandleSpecialTextOffset(const string16& text, LONG* offset); |
| 803 | 804 |
| 804 // Convert from a IA2TextBoundaryType to a ui::TextBoundaryType. | 805 // Convert from a IA2TextBoundaryType to a ui::TextBoundaryType. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 857 std::vector<int32> hyperlinks_; | 858 std::vector<int32> hyperlinks_; |
| 858 | 859 |
| 859 // Give BrowserAccessibility::Create access to our constructor. | 860 // Give BrowserAccessibility::Create access to our constructor. |
| 860 friend class BrowserAccessibility; | 861 friend class BrowserAccessibility; |
| 861 friend class BrowserAccessibilityRelation; | 862 friend class BrowserAccessibilityRelation; |
| 862 | 863 |
| 863 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); | 864 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); |
| 864 }; | 865 }; |
| 865 | 866 |
| 866 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 867 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ |
| OLD | NEW |