diff options
author | dtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 23:55:07 +0000 |
---|---|---|
committer | dtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 23:55:07 +0000 |
commit | a4286021fa025f747b4b6b699ff3639a4bdba8e4 (patch) | |
tree | c5dc8b45fbe387b4176d664c13eada2ed3d167e9 /views/view_win.cc | |
parent | 3e8d2d54f16890e9ca02244883ab35d72721da3c (diff) | |
download | chromium_src-a4286021fa025f747b4b6b699ff3639a4bdba8e4.zip chromium_src-a4286021fa025f747b4b6b699ff3639a4bdba8e4.tar.gz chromium_src-a4286021fa025f747b4b6b699ff3639a4bdba8e4.tar.bz2 |
Add initial tests for keyboard access (tabbing in some dialogs).
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/3015026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54074 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/view_win.cc')
-rw-r--r-- | views/view_win.cc | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/views/view_win.cc b/views/view_win.cc index 3079b5c..bbbe90e 100644 --- a/views/view_win.cc +++ b/views/view_win.cc @@ -11,6 +11,7 @@ #include "views/accessibility/view_accessibility.h" #include "views/accessibility/view_accessibility_wrapper.h" #include "views/border.h" +#include "views/views_delegate.h" #include "views/widget/root_view.h" #include "views/widget/widget.h" #include "views/widget/widget_win.h" @@ -30,15 +31,26 @@ int View::GetMenuShowDelay() { return delay; } -// Notifies accessibility clients of the event_type on this view. -// Clients will call get_accChild found in ViewAccessibility with the supplied -// child id we generate here to retrieve the IAccessible associated with this -// view. void View::NotifyAccessibilityEvent(AccessibilityTypes::Event event_type) { - 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); + NotifyAccessibilityEvent(event_type, true); +} + +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); + } } ViewAccessibilityWrapper* View::GetViewAccessibilityWrapper() { |