| 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/widget.h" | 10 #include "views/widget/widget.h" |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 if (child_id_as_index < view_->child_count()) { | 252 if (child_id_as_index < view_->child_count()) { |
| 253 // Note: child_id is a one based index when indexing children. | 253 // Note: child_id is a one based index when indexing children. |
| 254 child_view = view_->GetChildViewAt(child_id_as_index); | 254 child_view = view_->GetChildViewAt(child_id_as_index); |
| 255 } else { | 255 } else { |
| 256 // Attempt to retrieve a child view with the specified id. | 256 // Attempt to retrieve a child view with the specified id. |
| 257 child_view = view_->GetViewByID(child_id); | 257 child_view = view_->GetViewByID(child_id); |
| 258 } | 258 } |
| 259 } else { | 259 } else { |
| 260 // Negative values are used for events fired using the view's WidgetWin | 260 // Negative values are used for events fired using the view's WidgetWin |
| 261 views::WidgetWin* widget = | 261 views::WidgetWin* widget = |
| 262 static_cast<views::WidgetWin*>(view_->GetWidget()); | 262 static_cast<views::WidgetWin*>(view_->GetWidget()->native_widget()); |
| 263 child_view = widget->GetAccessibilityViewEventAt(child_id); | 263 child_view = widget->GetAccessibilityViewEventAt(child_id); |
| 264 } | 264 } |
| 265 | 265 |
| 266 if (!child_view) { | 266 if (!child_view) { |
| 267 // No child found. | 267 // No child found. |
| 268 *disp_child = NULL; | 268 *disp_child = NULL; |
| 269 return E_FAIL; | 269 return E_FAIL; |
| 270 } | 270 } |
| 271 | 271 |
| 272 *disp_child = GetAccessibleForView(child_view); | 272 *disp_child = GetAccessibleForView(child_view); |
| (...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 HWND native_view_window , IAccessible** accessible) { | 745 HWND native_view_window , IAccessible** accessible) { |
| 746 if (IsWindow(native_view_window)) { | 746 if (IsWindow(native_view_window)) { |
| 747 LRESULT ret = SendMessage(native_view_window, WM_GETOBJECT, 0, | 747 LRESULT ret = SendMessage(native_view_window, WM_GETOBJECT, 0, |
| 748 OBJID_CLIENT); | 748 OBJID_CLIENT); |
| 749 return ObjectFromLresult(ret, IID_IDispatch, 0, | 749 return ObjectFromLresult(ret, IID_IDispatch, 0, |
| 750 reinterpret_cast<void**>(accessible)); | 750 reinterpret_cast<void**>(accessible)); |
| 751 } | 751 } |
| 752 | 752 |
| 753 return E_FAIL; | 753 return E_FAIL; |
| 754 } | 754 } |
| OLD | NEW |