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 | 13 |
13 #include <vector> | 14 #include <vector> |
14 | 15 |
15 #include "content/browser/accessibility/browser_accessibility.h" | 16 #include "content/browser/accessibility/browser_accessibility.h" |
16 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
17 #include "third_party/iaccessible2/ia2_api_all.h" | 18 #include "third_party/iaccessible2/ia2_api_all.h" |
18 #include "third_party/isimpledom/ISimpleDOMDocument.h" | 19 #include "third_party/isimpledom/ISimpleDOMDocument.h" |
19 #include "third_party/isimpledom/ISimpleDOMNode.h" | 20 #include "third_party/isimpledom/ISimpleDOMNode.h" |
20 #include "third_party/isimpledom/ISimpleDOMText.h" | 21 #include "third_party/isimpledom/ISimpleDOMText.h" |
21 #include "webkit/glue/webaccessibility.h" | 22 #include "webkit/glue/webaccessibility.h" |
(...skipping 25 matching lines...) Expand all Loading... |
47 public IAccessibleHyperlink, | 48 public IAccessibleHyperlink, |
48 public IAccessibleHypertext, | 49 public IAccessibleHypertext, |
49 public IAccessibleImage, | 50 public IAccessibleImage, |
50 public IAccessibleTable, | 51 public IAccessibleTable, |
51 public IAccessibleTable2, | 52 public IAccessibleTable2, |
52 public IAccessibleTableCell, | 53 public IAccessibleTableCell, |
53 public IAccessibleValue, | 54 public IAccessibleValue, |
54 public IServiceProvider, | 55 public IServiceProvider, |
55 public ISimpleDOMDocument, | 56 public ISimpleDOMDocument, |
56 public ISimpleDOMNode, | 57 public ISimpleDOMNode, |
57 public ISimpleDOMText { | 58 public ISimpleDOMText, |
| 59 public IAccessibleEx, |
| 60 public IRawElementProviderSimple { |
58 public: | 61 public: |
59 BEGIN_COM_MAP(BrowserAccessibilityWin) | 62 BEGIN_COM_MAP(BrowserAccessibilityWin) |
60 COM_INTERFACE_ENTRY2(IDispatch, IAccessible2) | 63 COM_INTERFACE_ENTRY2(IDispatch, IAccessible2) |
61 COM_INTERFACE_ENTRY2(IAccessible, IAccessible2) | 64 COM_INTERFACE_ENTRY2(IAccessible, IAccessible2) |
62 COM_INTERFACE_ENTRY2(IAccessibleText, IAccessibleHypertext) | 65 COM_INTERFACE_ENTRY2(IAccessibleText, IAccessibleHypertext) |
63 COM_INTERFACE_ENTRY(IAccessible2) | 66 COM_INTERFACE_ENTRY(IAccessible2) |
64 COM_INTERFACE_ENTRY(IAccessibleHyperlink) | 67 COM_INTERFACE_ENTRY(IAccessibleHyperlink) |
65 COM_INTERFACE_ENTRY(IAccessibleHypertext) | 68 COM_INTERFACE_ENTRY(IAccessibleHypertext) |
66 COM_INTERFACE_ENTRY(IAccessibleImage) | 69 COM_INTERFACE_ENTRY(IAccessibleImage) |
67 COM_INTERFACE_ENTRY(IAccessibleTable) | 70 COM_INTERFACE_ENTRY(IAccessibleTable) |
68 COM_INTERFACE_ENTRY(IAccessibleTable2) | 71 COM_INTERFACE_ENTRY(IAccessibleTable2) |
69 COM_INTERFACE_ENTRY(IAccessibleTableCell) | 72 COM_INTERFACE_ENTRY(IAccessibleTableCell) |
70 COM_INTERFACE_ENTRY(IAccessibleValue) | 73 COM_INTERFACE_ENTRY(IAccessibleValue) |
71 COM_INTERFACE_ENTRY(IServiceProvider) | 74 COM_INTERFACE_ENTRY(IServiceProvider) |
72 COM_INTERFACE_ENTRY(ISimpleDOMDocument) | 75 COM_INTERFACE_ENTRY(ISimpleDOMDocument) |
73 COM_INTERFACE_ENTRY(ISimpleDOMNode) | 76 COM_INTERFACE_ENTRY(ISimpleDOMNode) |
74 COM_INTERFACE_ENTRY(ISimpleDOMText) | 77 COM_INTERFACE_ENTRY(ISimpleDOMText) |
| 78 COM_INTERFACE_ENTRY(IAccessibleEx) |
| 79 COM_INTERFACE_ENTRY(IRawElementProviderSimple) |
75 END_COM_MAP() | 80 END_COM_MAP() |
76 | 81 |
77 // Represents a non-static text node in IAccessibleHypertext. This character | 82 // Represents a non-static text node in IAccessibleHypertext. This character |
78 // is embedded in the response to IAccessibleText::get_text, indicating the | 83 // is embedded in the response to IAccessibleText::get_text, indicating the |
79 // position where a non-static text child object appears. | 84 // position where a non-static text child object appears. |
80 CONTENT_EXPORT static const char16 kEmbeddedCharacter[]; | 85 CONTENT_EXPORT static const char16 kEmbeddedCharacter[]; |
81 | 86 |
82 // Mappings from roles and states to human readable strings. Initialize | 87 // Mappings from roles and states to human readable strings. Initialize |
83 // with |InitializeStringMaps|. | 88 // with |InitializeStringMaps|. |
84 static std::map<int32, string16> role_string_map; | 89 static std::map<int32, string16> role_string_map; |
85 static std::map<int32, string16> state_string_map; | 90 static std::map<int32, string16> state_string_map; |
86 | 91 |
87 CONTENT_EXPORT BrowserAccessibilityWin(); | 92 CONTENT_EXPORT BrowserAccessibilityWin(); |
88 | 93 |
89 CONTENT_EXPORT virtual ~BrowserAccessibilityWin(); | 94 CONTENT_EXPORT virtual ~BrowserAccessibilityWin(); |
90 | 95 |
91 // | 96 // |
92 // BrowserAccessibility methods. | 97 // BrowserAccessibility methods. |
93 // | 98 // |
94 CONTENT_EXPORT virtual void PreInitialize(); | 99 CONTENT_EXPORT virtual void PreInitialize(); |
95 CONTENT_EXPORT virtual void PostInitialize(); | 100 CONTENT_EXPORT virtual void PostInitialize(); |
96 CONTENT_EXPORT virtual void NativeAddReference(); | 101 CONTENT_EXPORT virtual void NativeAddReference(); |
97 CONTENT_EXPORT virtual void NativeReleaseReference(); | 102 CONTENT_EXPORT virtual void NativeReleaseReference(); |
98 | 103 |
99 // | 104 // |
100 // IAccessible methods. | 105 // IAccessible methods. |
101 // | 106 // |
102 | 107 |
103 // Performs the default action on a given object. | 108 // Performs the default action on a given object. |
104 CONTENT_EXPORT STDMETHODIMP accDoDefaultAction(VARIANT var_id); | 109 CONTENT_EXPORT STDMETHODIMP accDoDefaultAction(VARIANT var_id); |
105 | 110 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 216 |
212 CONTENT_EXPORT STDMETHODIMP scrollToPoint( | 217 CONTENT_EXPORT STDMETHODIMP scrollToPoint( |
213 enum IA2CoordinateType coordinate_type, | 218 enum IA2CoordinateType coordinate_type, |
214 LONG x, | 219 LONG x, |
215 LONG y); | 220 LONG y); |
216 | 221 |
217 CONTENT_EXPORT STDMETHODIMP get_groupPosition(LONG* group_level, | 222 CONTENT_EXPORT STDMETHODIMP get_groupPosition(LONG* group_level, |
218 LONG* similar_items_in_group, | 223 LONG* similar_items_in_group, |
219 LONG* position_in_group); | 224 LONG* position_in_group); |
220 | 225 |
221 // IAccessible2 methods not implemented. | 226 // |
| 227 // IAccessibleEx methods not implemented. |
| 228 // |
222 CONTENT_EXPORT STDMETHODIMP get_extendedRole(BSTR* extended_role) { | 229 CONTENT_EXPORT STDMETHODIMP get_extendedRole(BSTR* extended_role) { |
223 return E_NOTIMPL; | 230 return E_NOTIMPL; |
224 } | 231 } |
225 CONTENT_EXPORT STDMETHODIMP get_localizedExtendedRole( | 232 CONTENT_EXPORT STDMETHODIMP get_localizedExtendedRole( |
226 BSTR* localized_extended_role) { | 233 BSTR* localized_extended_role) { |
227 return E_NOTIMPL; | 234 return E_NOTIMPL; |
228 } | 235 } |
229 CONTENT_EXPORT STDMETHODIMP get_nExtendedStates(LONG* n_extended_states) { | 236 CONTENT_EXPORT STDMETHODIMP get_nExtendedStates(LONG* n_extended_states) { |
230 return E_NOTIMPL; | 237 return E_NOTIMPL; |
231 } | 238 } |
232 CONTENT_EXPORT STDMETHODIMP get_extendedStates(LONG max_extended_states, | 239 CONTENT_EXPORT STDMETHODIMP get_extendedStates(LONG max_extended_states, |
233 BSTR** extended_states, | 240 BSTR** extended_states, |
234 LONG* n_extended_states) { | 241 LONG* n_extended_states) { |
235 return E_NOTIMPL; | 242 return E_NOTIMPL; |
236 } | 243 } |
237 CONTENT_EXPORT STDMETHODIMP get_localizedExtendedStates( | 244 CONTENT_EXPORT STDMETHODIMP get_localizedExtendedStates( |
238 LONG max_localized_extended_states, | 245 LONG max_localized_extended_states, |
239 BSTR** localized_extended_states, | 246 BSTR** localized_extended_states, |
240 LONG* n_localized_extended_states) { | 247 LONG* n_localized_extended_states) { |
241 return E_NOTIMPL; | 248 return E_NOTIMPL; |
242 } | 249 } |
243 CONTENT_EXPORT STDMETHODIMP get_locale(IA2Locale* locale) { | 250 CONTENT_EXPORT STDMETHODIMP get_locale(IA2Locale* locale) { |
244 return E_NOTIMPL; | 251 return E_NOTIMPL; |
245 } | 252 } |
246 | 253 |
247 // | 254 // |
248 // IAccessibleImage methods. | 255 // IAccessibleImage methods. |
249 // | 256 // |
250 | |
251 CONTENT_EXPORT STDMETHODIMP get_description(BSTR* description); | 257 CONTENT_EXPORT STDMETHODIMP get_description(BSTR* description); |
252 | 258 |
253 CONTENT_EXPORT STDMETHODIMP get_imagePosition( | 259 CONTENT_EXPORT STDMETHODIMP get_imagePosition( |
254 enum IA2CoordinateType coordinate_type, | 260 enum IA2CoordinateType coordinate_type, |
255 LONG* x, | 261 LONG* x, |
256 LONG* y); | 262 LONG* y); |
257 | 263 |
258 CONTENT_EXPORT STDMETHODIMP get_imageSize(LONG* height, LONG* width); | 264 CONTENT_EXPORT STDMETHODIMP get_imageSize(LONG* height, LONG* width); |
259 | 265 |
260 // | 266 // |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 return E_NOTIMPL; | 691 return E_NOTIMPL; |
686 } | 692 } |
687 | 693 |
688 // | 694 // |
689 // IServiceProvider methods. | 695 // IServiceProvider methods. |
690 // | 696 // |
691 | 697 |
692 CONTENT_EXPORT STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, | 698 CONTENT_EXPORT STDMETHODIMP QueryService(REFGUID guidService, REFIID riid, |
693 void** object); | 699 void** object); |
694 | 700 |
| 701 // IAccessibleEx methods not implemented. |
| 702 CONTENT_EXPORT STDMETHODIMP GetObjectForChild(long child_id, |
| 703 IAccessibleEx** ret) { |
| 704 return E_NOTIMPL; |
| 705 } |
| 706 |
| 707 CONTENT_EXPORT STDMETHODIMP GetIAccessiblePair(IAccessible** acc, |
| 708 long* child_id) { |
| 709 return E_NOTIMPL; |
| 710 } |
| 711 |
| 712 CONTENT_EXPORT STDMETHODIMP GetRuntimeId(SAFEARRAY** runtime_id) { |
| 713 return E_NOTIMPL; |
| 714 } |
| 715 |
| 716 CONTENT_EXPORT STDMETHODIMP ConvertReturnedElement( |
| 717 IRawElementProviderSimple* element, |
| 718 IAccessibleEx** acc) { |
| 719 return E_NOTIMPL; |
| 720 } |
| 721 |
| 722 // |
| 723 // IRawElementProviderSimple methods. |
| 724 // |
| 725 // The GetPatternProvider/GetPropertyValue methods need to be implemented for |
| 726 // the on-screen keyboard to show up in Windows 8 metro. |
| 727 CONTENT_EXPORT STDMETHODIMP GetPatternProvider(PATTERNID id, |
| 728 IUnknown** provider); |
| 729 CONTENT_EXPORT STDMETHODIMP GetPropertyValue(PROPERTYID id, VARIANT* ret); |
| 730 |
| 731 // |
| 732 // IRawElementProviderSimple methods not implemented |
| 733 // |
| 734 CONTENT_EXPORT STDMETHODIMP get_ProviderOptions(enum ProviderOptions* ret) { |
| 735 return E_NOTIMPL; |
| 736 } |
| 737 |
| 738 CONTENT_EXPORT STDMETHODIMP get_HostRawElementProvider( |
| 739 IRawElementProviderSimple** provider) { |
| 740 return E_NOTIMPL; |
| 741 } |
| 742 |
695 // | 743 // |
696 // CComObjectRootEx methods. | 744 // CComObjectRootEx methods. |
697 // | 745 // |
698 | 746 |
699 CONTENT_EXPORT HRESULT WINAPI InternalQueryInterface(void* this_ptr, | 747 CONTENT_EXPORT HRESULT WINAPI InternalQueryInterface(void* this_ptr, |
700 const _ATL_INTMAP_ENTRY* entries, | 748 const _ATL_INTMAP_ENTRY* entries, |
701 REFIID iid, | 749 REFIID iid, |
702 void** object); | 750 void** object); |
703 | 751 |
704 // Accessors to IA2 role and state. | 752 // Accessors to IA2 role and state. |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 std::vector<int32> hyperlinks_; | 858 std::vector<int32> hyperlinks_; |
811 | 859 |
812 // Give BrowserAccessibility::Create access to our constructor. | 860 // Give BrowserAccessibility::Create access to our constructor. |
813 friend class BrowserAccessibility; | 861 friend class BrowserAccessibility; |
814 friend class BrowserAccessibilityRelation; | 862 friend class BrowserAccessibilityRelation; |
815 | 863 |
816 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); | 864 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityWin); |
817 }; | 865 }; |
818 | 866 |
819 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ | 867 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_WIN_H_ |
OLD | NEW |