OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "views/accessibility/view_accessibility.h" | 5 #include "views/accessibility/view_accessibility.h" |
6 | 6 |
7 #include "app/view_prop.h" | 7 #include "ui/base/view_prop.h" |
8 #include "views/controls/button/native_button.h" | 8 #include "views/controls/button/native_button.h" |
9 #include "views/widget/widget.h" | 9 #include "views/widget/widget.h" |
10 #include "views/widget/widget_win.h" | 10 #include "views/widget/widget_win.h" |
11 | 11 |
12 const char kViewsNativeHostPropForAccessibility[] = | 12 const char kViewsNativeHostPropForAccessibility[] = |
13 "Views_NativeViewHostHWNDForAccessibility"; | 13 "Views_NativeViewHostHWNDForAccessibility"; |
14 | 14 |
15 // static | 15 // static |
16 scoped_refptr<ViewAccessibility> ViewAccessibility::Create(views::View* view) { | 16 scoped_refptr<ViewAccessibility> ViewAccessibility::Create(views::View* view) { |
17 CComObject<ViewAccessibility>* instance = NULL; | 17 CComObject<ViewAccessibility>* instance = NULL; |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
718 return msaa_state; | 718 return msaa_state; |
719 } | 719 } |
720 | 720 |
721 // static | 721 // static |
722 HRESULT ViewAccessibility::GetNativeIAccessibleInterface( | 722 HRESULT ViewAccessibility::GetNativeIAccessibleInterface( |
723 views::NativeViewHost* native_host, IAccessible** accessible) { | 723 views::NativeViewHost* native_host, IAccessible** accessible) { |
724 if (!native_host || !accessible) | 724 if (!native_host || !accessible) |
725 return E_INVALIDARG; | 725 return E_INVALIDARG; |
726 | 726 |
727 HWND native_view_window = static_cast<HWND>( | 727 HWND native_view_window = static_cast<HWND>( |
728 app::ViewProp::GetValue(native_host->native_view(), | 728 ui::ViewProp::GetValue(native_host->native_view(), |
729 kViewsNativeHostPropForAccessibility)); | 729 kViewsNativeHostPropForAccessibility)); |
730 if (!IsWindow(native_view_window)) { | 730 if (!IsWindow(native_view_window)) { |
731 native_view_window = native_host->native_view(); | 731 native_view_window = native_host->native_view(); |
732 } | 732 } |
733 | 733 |
734 return GetNativeIAccessibleInterface(native_view_window, accessible); | 734 return GetNativeIAccessibleInterface(native_view_window, accessible); |
735 } | 735 } |
736 | 736 |
737 // static | 737 // static |
738 HRESULT ViewAccessibility::GetNativeIAccessibleInterface( | 738 HRESULT ViewAccessibility::GetNativeIAccessibleInterface( |
739 HWND native_view_window , IAccessible** accessible) { | 739 HWND native_view_window , IAccessible** accessible) { |
740 if (IsWindow(native_view_window)) { | 740 if (IsWindow(native_view_window)) { |
741 LRESULT ret = SendMessage(native_view_window, WM_GETOBJECT, 0, | 741 LRESULT ret = SendMessage(native_view_window, WM_GETOBJECT, 0, |
742 OBJID_CLIENT); | 742 OBJID_CLIENT); |
743 return ObjectFromLresult(ret, IID_IDispatch, 0, | 743 return ObjectFromLresult(ret, IID_IDispatch, 0, |
744 reinterpret_cast<void**>(accessible)); | 744 reinterpret_cast<void**>(accessible)); |
745 } | 745 } |
746 | 746 |
747 return E_FAIL; | 747 return E_FAIL; |
748 } | 748 } |
OLD | NEW |