summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-06 07:07:18 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-06 07:07:18 +0000
commit6a054ffaae82f5ac8d6b876d7c85f0d87d892e42 (patch)
tree86b4d5a0c5386f3d50742af099b5009ad1dad14d /views
parent6ca800b9b2618e6ae4b92e189a9b1ae73746e49f (diff)
downloadchromium_src-6a054ffaae82f5ac8d6b876d7c85f0d87d892e42.zip
chromium_src-6a054ffaae82f5ac8d6b876d7c85f0d87d892e42.tar.gz
chromium_src-6a054ffaae82f5ac8d6b876d7c85f0d87d892e42.tar.bz2
Improvements to accessibility extension api support for "views":
1. Handles the new wrench menu. 2. Uses NotifyAccessibilityEvent to find out when focus changes, rather than installing focus change listeners that need to be cleaned up. BUG=none TEST=Updated AccessibilityEventRouterViewsTest.TestFocusNotification Review URL: http://codereview.chromium.org/3056045 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55196 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/controls/native_control_gtk.cc2
-rw-r--r--views/controls/native_control_win.cc14
-rw-r--r--views/focus/focus_manager_win.cc6
-rw-r--r--views/view.cc7
-rw-r--r--views/view_gtk.cc4
-rw-r--r--views/view_win.cc4
-rw-r--r--views/views.gyp3
7 files changed, 20 insertions, 20 deletions
diff --git a/views/controls/native_control_gtk.cc b/views/controls/native_control_gtk.cc
index 3b0325c..e0ce2f0 100644
--- a/views/controls/native_control_gtk.cc
+++ b/views/controls/native_control_gtk.cc
@@ -66,6 +66,8 @@ void NativeControlGtk::VisibilityChanged(View* starting_from, bool is_visible) {
void NativeControlGtk::Focus() {
DCHECK(native_view());
gtk_widget_grab_focus(native_view());
+
+ GetParent()->NotifyAccessibilityEvent(AccessibilityTypes::EVENT_FOCUS);
}
void NativeControlGtk::NativeControlCreated(GtkWidget* native_control) {
diff --git a/views/controls/native_control_win.cc b/views/controls/native_control_win.cc
index 6d23a5c..ba27f85 100644
--- a/views/controls/native_control_win.cc
+++ b/views/controls/native_control_win.cc
@@ -102,11 +102,15 @@ void NativeControlWin::Focus() {
View* parent_view = GetParent();
// Due to some controls not behaving as expected without having
- // a native win32 control, we exclude the following from sending
- // their IAccessible as focus events.
- if (parent_view->GetClassName() != views::Combobox::kViewClassName &&
- parent_view->HasFocus())
- parent_view->NotifyAccessibilityEvent(AccessibilityTypes::EVENT_FOCUS);
+ // a native win32 control, we don't always send a native (MSAA)
+ // focus notification.
+ bool send_native_event =
+ parent_view->GetClassName() != views::Combobox::kViewClassName &&
+ parent_view->HasFocus();
+
+ // Send the accessibility focus notification.
+ parent_view->NotifyAccessibilityEvent(AccessibilityTypes::EVENT_FOCUS,
+ send_native_event);
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/views/focus/focus_manager_win.cc b/views/focus/focus_manager_win.cc
index b08bf15..faf3815 100644
--- a/views/focus/focus_manager_win.cc
+++ b/views/focus/focus_manager_win.cc
@@ -12,12 +12,6 @@ namespace views {
void FocusManager::ClearNativeFocus() {
// Keep the top root window focused so we get keyboard events.
::SetFocus(widget_->GetNativeView());
-
- // We need to let assistive technologies know which child view got focus so
- // they can obtain the proper accessibility object for that child view.
- if (focused_view_) {
- focused_view_->NotifyAccessibilityEvent(AccessibilityTypes::EVENT_FOCUS);
- }
}
void FocusManager::FocusNativeView(gfx::NativeView native_view) {
diff --git a/views/view.cc b/views/view.cc
index c8e35de..02d2766 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -314,6 +314,13 @@ void View::Focus() {
FocusManager* focus_manager = GetFocusManager();
if (focus_manager)
focus_manager->ClearNativeFocus();
+
+ // Notify assistive technologies of the focus change.
+ NotifyAccessibilityEvent(AccessibilityTypes::EVENT_FOCUS);
+}
+
+void View::NotifyAccessibilityEvent(AccessibilityTypes::Event event_type) {
+ NotifyAccessibilityEvent(event_type, true);
}
void View::SetHotTracked(bool flag) {
diff --git a/views/view_gtk.cc b/views/view_gtk.cc
index d74598d..602e4c0 100644
--- a/views/view_gtk.cc
+++ b/views/view_gtk.cc
@@ -21,10 +21,6 @@ int View::GetMenuShowDelay() {
return kShowFolderDropMenuDelay;
}
-void View::NotifyAccessibilityEvent(AccessibilityTypes::Event event_type) {
- NotifyAccessibilityEvent(event_type, true);
-}
-
void View::NotifyAccessibilityEvent(AccessibilityTypes::Event event_type,
bool send_native_event) {
// Send the notification to the delegate.
diff --git a/views/view_win.cc b/views/view_win.cc
index bbbe90e..79492bb 100644
--- a/views/view_win.cc
+++ b/views/view_win.cc
@@ -31,10 +31,6 @@ int View::GetMenuShowDelay() {
return delay;
}
-void View::NotifyAccessibilityEvent(AccessibilityTypes::Event event_type) {
- NotifyAccessibilityEvent(event_type, true);
-}
-
void View::NotifyAccessibilityEvent(AccessibilityTypes::Event event_type,
bool send_native_event) {
// Send the notification to the delegate.
diff --git a/views/views.gyp b/views/views.gyp
index 1946a18..2e137da 100644
--- a/views/views.gyp
+++ b/views/views.gyp
@@ -262,10 +262,11 @@
'view.h',
'view_constants.cc',
'view_constants.h',
+ 'view_gtk.cc',
'view_text_utils.cc',
'view_text_utils.h',
- 'view_gtk.cc',
'view_win.cc',
+ 'views_delegate.h',
'widget/aero_tooltip_manager.cc',
'widget/aero_tooltip_manager.h',
'widget/default_theme_provider.cc',