OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 return E_FAIL; | 120 return E_FAIL; |
121 | 121 |
122 AccessibilityObject* parentObj = m_object->parentObject(); | 122 AccessibilityObject* parentObj = m_object->parentObject(); |
123 | 123 |
124 if (parentObj) { | 124 if (parentObj) { |
125 *parent = static_cast<IDispatch*>(wrapper(parentObj)); | 125 *parent = static_cast<IDispatch*>(wrapper(parentObj)); |
126 (*parent)->AddRef(); | 126 (*parent)->AddRef(); |
127 return S_OK; | 127 return S_OK; |
128 } | 128 } |
129 | 129 |
130 » HMODULE accessibilityLib = ::LoadLibrary(TEXT("oleacc.dll")); | 130 HMODULE accessibilityLib = ::LoadLibrary(TEXT("oleacc.dll")); |
131 | 131 |
132 static LPFNACCESSIBLEOBJECTFROMWINDOW procPtr = reinterpret_cast<LPFNACCESSI
BLEOBJECTFROMWINDOW>(::GetProcAddress(accessibilityLib, "AccessibleObjectFromWin
dow")); | 132 static LPFNACCESSIBLEOBJECTFROMWINDOW procPtr = reinterpret_cast<LPFNACCESSI
BLEOBJECTFROMWINDOW>(::GetProcAddress(accessibilityLib, "AccessibleObjectFromWin
dow")); |
133 if (!procPtr) | 133 if (!procPtr) |
134 return E_FAIL; | 134 return E_FAIL; |
135 | 135 |
136 // TODO(eseidel): platformWindow returns a void* which is an opaque | 136 // TODO(eseidel): platformWindow returns a void* which is an opaque |
137 // identifier corresponding to the HWND WebKit is embedded in. It happens | 137 // identifier corresponding to the HWND WebKit is embedded in. It happens |
138 // to be the case that platformWindow is a valid HWND pointer (inaccessible | 138 // to be the case that platformWindow is a valid HWND pointer (inaccessible |
139 // from the sandboxed renderer). | 139 // from the sandboxed renderer). |
140 HWND window = static_cast<HWND>(m_object->topDocumentFrameView()->hostWindow
()->platformWindow()); | 140 HWND window = reinterpret_cast<HWND>(m_object->topDocumentFrameView()->hostW
indow()->platformWindow()); |
141 » return procPtr(window, OBJID_WINDOW, __uuidof(IAccessible), reinterpret_
cast<void**>(parent)); | 141 return procPtr(window, OBJID_WINDOW, __uuidof(IAccessible), reinterpret_cast
<void**>(parent)); |
142 } | 142 } |
143 | 143 |
144 HRESULT STDMETHODCALLTYPE AccessibleBase::get_accChildCount(long* count) | 144 HRESULT STDMETHODCALLTYPE AccessibleBase::get_accChildCount(long* count) |
145 { | 145 { |
146 if (!m_object) | 146 if (!m_object) |
147 return E_FAIL; | 147 return E_FAIL; |
148 if (!count) | 148 if (!count) |
149 return E_POINTER; | 149 return E_POINTER; |
150 *count = static_cast<long>(m_object->children().size()); | 150 *count = static_cast<long>(m_object->children().size()); |
151 return S_OK; | 151 return S_OK; |
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
683 return S_OK; | 683 return S_OK; |
684 } | 684 } |
685 | 685 |
686 AccessibleBase* AccessibleBase::wrapper(AccessibilityObject* obj) | 686 AccessibleBase* AccessibleBase::wrapper(AccessibilityObject* obj) |
687 { | 687 { |
688 AccessibleBase* result = static_cast<AccessibleBase*>(obj->wrapper()); | 688 AccessibleBase* result = static_cast<AccessibleBase*>(obj->wrapper()); |
689 if (!result) | 689 if (!result) |
690 result = createInstance(obj); | 690 result = createInstance(obj); |
691 return result; | 691 return result; |
692 } | 692 } |
OLD | NEW |