| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/native_view_accessibility_win.h" | 5 #include "views/accessibility/native_view_accessibility_win.h" |
| 6 | 6 |
| 7 #include "ui/base/accessibility/accessible_view_state.h" | 7 #include "ui/base/accessibility/accessible_view_state.h" |
| 8 #include "ui/base/view_prop.h" | 8 #include "ui/base/view_prop.h" |
| 9 #include "views/controls/button/native_button.h" | 9 #include "views/controls/button/native_button.h" |
| 10 #include "views/widget/native_widget_win.h" | 10 #include "views/widget/native_widget_win.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 // First, check to see if the view is a native view. | 36 // First, check to see if the view is a native view. |
| 37 if (view->GetClassName() == views::NativeViewHost::kViewClassName) { | 37 if (view->GetClassName() == views::NativeViewHost::kViewClassName) { |
| 38 views::NativeViewHost* native_host = | 38 views::NativeViewHost* native_host = |
| 39 static_cast<views::NativeViewHost*>(view); | 39 static_cast<views::NativeViewHost*>(view); |
| 40 if (GetNativeIAccessibleInterface(native_host, &accessible) == S_OK) | 40 if (GetNativeIAccessibleInterface(native_host, &accessible) == S_OK) |
| 41 return accessible; | 41 return accessible; |
| 42 } | 42 } |
| 43 | 43 |
| 44 // Next, see if the view is a widget container. | 44 // Next, see if the view is a widget container. |
| 45 if (view->child_widget()) { | 45 if (view->GetChildWidget()) { |
| 46 views::NativeWidgetWin* native_widget = | 46 views::NativeWidgetWin* native_widget = |
| 47 reinterpret_cast<views::NativeWidgetWin*>(view->child_widget()); | 47 reinterpret_cast<views::NativeWidgetWin*>(view->GetChildWidget()); |
| 48 if (GetNativeIAccessibleInterface( | 48 if (GetNativeIAccessibleInterface( |
| 49 native_widget->GetNativeView(), &accessible) == S_OK) { | 49 native_widget->GetNativeView(), &accessible) == S_OK) { |
| 50 return accessible; | 50 return accessible; |
| 51 } | 51 } |
| 52 } | 52 } |
| 53 | 53 |
| 54 // Finally, use our NativeViewAccessibilityWin implementation. | 54 // Finally, use our NativeViewAccessibilityWin implementation. |
| 55 return view->GetNativeViewAccessibilityWin(); | 55 return view->GetNativeViewAccessibilityWin(); |
| 56 } | 56 } |
| 57 | 57 |
| (...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 HWND native_view_window , IAccessible** accessible) { | 746 HWND native_view_window , IAccessible** accessible) { |
| 747 if (IsWindow(native_view_window)) { | 747 if (IsWindow(native_view_window)) { |
| 748 LRESULT ret = SendMessage(native_view_window, WM_GETOBJECT, 0, | 748 LRESULT ret = SendMessage(native_view_window, WM_GETOBJECT, 0, |
| 749 OBJID_CLIENT); | 749 OBJID_CLIENT); |
| 750 return ObjectFromLresult(ret, IID_IDispatch, 0, | 750 return ObjectFromLresult(ret, IID_IDispatch, 0, |
| 751 reinterpret_cast<void**>(accessible)); | 751 reinterpret_cast<void**>(accessible)); |
| 752 } | 752 } |
| 753 | 753 |
| 754 return E_FAIL; | 754 return E_FAIL; |
| 755 } | 755 } |
| OLD | NEW |