diff options
author | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 00:39:07 +0000 |
---|---|---|
committer | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-04 00:39:07 +0000 |
commit | bb837f9287259862c94155cc59cfc9e1bdfe1258 (patch) | |
tree | f23a7dabe56a4b4c9288ea022f65c090a4fc536b /views/view_win.cc | |
parent | d19e63d5bd3a61fc46bae0c527731c79abb94957 (diff) | |
download | chromium_src-bb837f9287259862c94155cc59cfc9e1bdfe1258.zip chromium_src-bb837f9287259862c94155cc59cfc9e1bdfe1258.tar.gz chromium_src-bb837f9287259862c94155cc59cfc9e1bdfe1258.tar.bz2 |
Revert 76825 - Refactor Views accessibility.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6581010
TBR=dmazzoni@chromium.org
Review URL: http://codereview.chromium.org/6612035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76844 0039d316-1c4b-4281-b951-d872f2087c98
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() { |