Index: views/controls/native/native_view_host_win.cc |
=================================================================== |
--- views/controls/native/native_view_host_win.cc (revision 88807) |
+++ views/controls/native/native_view_host_win.cc (working copy) |
@@ -4,6 +4,8 @@ |
#include "views/controls/native/native_view_host_win.h" |
+#include <oleacc.h> |
+ |
#include "base/logging.h" |
#include "ui/gfx/canvas.h" |
#include "views/controls/native/native_view_host.h" |
@@ -123,6 +125,22 @@ |
::SetFocus(host_->native_view()); |
} |
+gfx::NativeViewAccessible NativeViewHostWin::GetNativeViewAccessible() { |
+ HWND hwnd = host_->native_view(); |
+ if (!IsWindow(hwnd)) |
+ return NULL; |
+ |
+ LRESULT ret = SendMessage(hwnd, WM_GETOBJECT, 0, OBJID_CLIENT); |
+ IAccessible* accessible = NULL; |
+ HRESULT success = ObjectFromLresult( |
+ ret, IID_IDispatch, 0, reinterpret_cast<void**>(accessible)); |
+ if (success == S_OK) { |
+ return accessible; |
+ } else { |
+ return NULL; |
+ } |
+} |
+ |
//////////////////////////////////////////////////////////////////////////////// |
// NativeViewHostWrapper, public: |