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 #include "ui/views/accessibility/native_view_accessibility_win.h" | 5 #include "ui/views/accessibility/native_view_accessibility_win.h" |
6 | 6 |
7 #include <oleacc.h> | 7 #include <oleacc.h> |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "base/win/scoped_comptr.h" | 14 #include "base/win/scoped_comptr.h" |
15 #include "base/win/windows_version.h" | 15 #include "base/win/windows_version.h" |
16 #include "third_party/iaccessible2/ia2_api_all.h" | 16 #include "third_party/iaccessible2/ia2_api_all.h" |
17 #include "ui/accessibility/ax_enums.h" | 17 #include "ui/accessibility/ax_enums.h" |
18 #include "ui/accessibility/ax_node_data.h" | 18 #include "ui/accessibility/ax_node_data.h" |
19 #include "ui/accessibility/ax_text_utils.h" | 19 #include "ui/accessibility/ax_text_utils.h" |
20 #include "ui/base/win/accessibility_misc_utils.h" | 20 #include "ui/base/win/accessibility_misc_utils.h" |
21 #include "ui/base/win/atl_module.h" | 21 #include "ui/base/win/atl_module.h" |
22 #include "ui/views/controls/button/custom_button.h" | 22 #include "ui/views/controls/button/custom_button.h" |
23 #include "ui/views/focus/focus_manager.h" | 23 #include "ui/views/focus/focus_manager.h" |
24 #include "ui/views/focus/view_storage.h" | 24 #include "ui/views/focus/view_storage.h" |
25 #include "ui/views/widget/widget.h" | 25 #include "ui/views/widget/widget.h" |
26 #include "ui/views/win/hwnd_util.h" | 26 #include "ui/views/win/hwnd_util.h" |
27 | 27 |
28 namespace views { | 28 namespace views { |
29 | 29 |
30 // static | |
31 NativeViewAccessibility* NativeViewAccessibility::Create(View* view) { | |
32 return new NativeViewAccessibilityWin(view); | |
33 } | |
34 | |
35 NativeViewAccessibilityWin::NativeViewAccessibilityWin(View* view) | |
36 : NativeViewAccessibility(view) { | |
37 } | |
38 | |
39 NativeViewAccessibilityWin::~NativeViewAccessibilityWin() { | |
40 } | |
41 | |
42 gfx::NativeViewAccessible NativeViewAccessibilityWin::GetParent() { | 30 gfx::NativeViewAccessible NativeViewAccessibilityWin::GetParent() { |
43 IAccessible* parent = NativeViewAccessibility::GetParent(); | 31 IAccessible* parent = NativeViewAccessibility::GetParent(); |
44 if (parent) | 32 if (parent) |
45 return parent; | 33 return parent; |
46 | 34 |
47 HWND hwnd = HWNDForView(view_); | 35 HWND hwnd = HWNDForView(view_); |
48 if (!hwnd) | 36 if (!hwnd) |
49 return NULL; | 37 return NULL; |
50 | 38 |
51 HRESULT hr = ::AccessibleObjectFromWindow( | 39 HRESULT hr = ::AccessibleObjectFromWindow( |
52 hwnd, OBJID_WINDOW, IID_IAccessible, | 40 hwnd, OBJID_WINDOW, IID_IAccessible, |
53 reinterpret_cast<void**>(&parent)); | 41 reinterpret_cast<void**>(&parent)); |
54 if (SUCCEEDED(hr)) | 42 if (SUCCEEDED(hr)) |
55 return parent; | 43 return parent; |
56 | 44 |
57 return NULL; | 45 return NULL; |
58 } | 46 } |
59 | 47 |
60 gfx::AcceleratedWidget | 48 gfx::AcceleratedWidget |
61 NativeViewAccessibilityWin::GetTargetForNativeAccessibilityEvent() { | 49 NativeViewAccessibilityWin::GetTargetForNativeAccessibilityEvent() { |
62 return HWNDForView(view_); | 50 return HWNDForView(view_); |
63 } | 51 } |
64 | 52 |
53 NativeViewAccessibilityWin::NativeViewAccessibilityWin(View* view) | |
54 : NativeViewAccessibility(view) {} | |
55 | |
56 NativeViewAccessibilityWin::~NativeViewAccessibilityWin() {} | |
57 | |
58 // static | |
59 NativeViewAccessibility* NativeViewAccessibility::Create(View* view) { | |
60 return new NativeViewAccessibilityWin(view); | |
61 } | |
tapted
2017/02/21 06:01:12
These reorderings (here and in auralinux.cc) might
Patti Lor
2017/02/27 05:31:04
Moved them to the other CL.
| |
62 | |
65 } // namespace views | 63 } // namespace views |
OLD | NEW |