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
3 // found in the LICENSE file.
5 #include "ui/views/accessibility/native_view_accessibility_win.h"
12 #include "base/memory/singleton.h"
13 #include "base/strings/utf_string_conversions.h"
14 #include "base/win/scoped_comptr.h"
15 #include "base/win/windows_version.h"
16 #include "third_party/iaccessible2/ia2_api_all.h"
17 #include "ui/accessibility/ax_enums.h"
18 #include "ui/accessibility/ax_text_utils.h"
19 #include "ui/accessibility/ax_view_state.h"
20 #include "ui/base/win/accessibility_misc_utils.h"
21 #include "ui/base/win/atl_module.h"
22 #include "ui/views/controls/button/custom_button.h"
23 #include "ui/views/focus/focus_manager.h"
24 #include "ui/views/focus/view_storage.h"
25 #include "ui/views/widget/widget.h"
26 #include "ui/views/win/hwnd_util.h"
31 NativeViewAccessibility
* NativeViewAccessibility::Create(View
* view
) {
32 return new NativeViewAccessibilityWin(view
);
35 NativeViewAccessibilityWin::NativeViewAccessibilityWin(View
* view
)
36 : NativeViewAccessibility(view
) {
39 NativeViewAccessibilityWin::~NativeViewAccessibilityWin() {
42 gfx::NativeViewAccessible
NativeViewAccessibilityWin::GetParent() {
43 IAccessible
* parent
= NativeViewAccessibility::GetParent();
47 HWND hwnd
= HWNDForView(view_
);
51 HRESULT hr
= ::AccessibleObjectFromWindow(
52 hwnd
, OBJID_WINDOW
, IID_IAccessible
,
53 reinterpret_cast<void**>(&parent
));
60 gfx::AcceleratedWidget
61 NativeViewAccessibilityWin::GetTargetForNativeAccessibilityEvent() {
62 return HWNDForView(view_
);