diff options
Diffstat (limited to 'views/view_win.cc')
-rw-r--r-- | views/view_win.cc | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/views/view_win.cc b/views/view_win.cc index 011b319..2c213c2 100644 --- a/views/view_win.cc +++ b/views/view_win.cc @@ -13,7 +13,7 @@ #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/gfx/canvas.h" #include "ui/gfx/path.h" -#include "views/accessibility/native_view_accessibility_win.h" +#include "views/accessibility/view_accessibility.h" #include "views/border.h" #include "views/views_delegate.h" #include "views/widget/root_view.h" @@ -22,11 +22,28 @@ namespace views { -NativeViewAccessibilityWin* View::GetNativeViewAccessibilityWin() { - if (!native_view_accessibility_win_.get()) - native_view_accessibility_win_.swap( - NativeViewAccessibilityWin::Create(this)); - return native_view_accessibility_win_.get(); +void View::NotifyAccessibilityEvent(AccessibilityTypes::Event event_type, + bool send_native_event) { + // Send the notification to the delegate. + if (ViewsDelegate::views_delegate) + ViewsDelegate::views_delegate->NotifyAccessibilityEvent(this, event_type); + + // Now call the Windows-specific method to notify MSAA clients of this + // event. The widget gives us a temporary unique child ID to associate + // with this view so that clients can call get_accChild in ViewAccessibility + // to retrieve the IAccessible associated with this view. + if (send_native_event) { + WidgetWin* view_widget = static_cast<WidgetWin*>(GetWidget()); + int child_id = view_widget->AddAccessibilityViewEvent(this); + ::NotifyWinEvent(ViewAccessibility::MSAAEvent(event_type), + view_widget->GetNativeView(), OBJID_CLIENT, child_id); + } +} + +ViewAccessibility* View::GetViewAccessibility() { + if (!view_accessibility_.get()) + view_accessibility_.swap(ViewAccessibility::Create(this)); + return view_accessibility_.get(); } int View::GetHorizontalDragThreshold() { |