diff options
author | ctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-16 00:23:42 +0000 |
---|---|---|
committer | ctguil@chromium.org <ctguil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-16 00:23:42 +0000 |
commit | 9892b477aaf5bc739bc1a896052266ad13c79ac0 (patch) | |
tree | de4c76231e3c3ff69e2ce82c848f08a1023d4f93 /chrome/browser/renderer_host | |
parent | d83a560943d1fdfcf9ec46ea001248a46e6148a7 (diff) | |
download | chromium_src-9892b477aaf5bc739bc1a896052266ad13c79ac0.zip chromium_src-9892b477aaf5bc739bc1a896052266ad13c79ac0.tar.gz chromium_src-9892b477aaf5bc739bc1a896052266ad13c79ac0.tar.bz2 |
Add support for webkit ValueChanged accessibility notification.
BUG=13291
TEST=interactive_ui_tests:AccessibilityWinBrowserTest.TestNotification*
Review URL: http://codereview.chromium.org/3341021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59589 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
7 files changed, 33 insertions, 53 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 37548bf..b973cd4 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -847,10 +847,8 @@ void RenderViewHost::OnMessageReceived(const IPC::Message& msg) { OnExtensionPostMessage) IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityFocusChange, OnAccessibilityFocusChange) - IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityObjectStateChange, - OnAccessibilityObjectStateChange) - IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityObjectChildrenChange, - OnAccessibilityObjectChildrenChange) + IPC_MESSAGE_HANDLER(ViewHostMsg_AccessibilityNotifications, + OnAccessibilityNotifications) IPC_MESSAGE_HANDLER(ViewHostMsg_OnCSSInserted, OnCSSInserted) IPC_MESSAGE_HANDLER(ViewHostMsg_PageContents, OnPageContents) IPC_MESSAGE_HANDLER(ViewHostMsg_PageTranslated, OnPageTranslated) @@ -1979,23 +1977,12 @@ void RenderViewHost::OnAccessibilityFocusChange(int acc_obj_id) { view()->OnAccessibilityFocusChange(acc_obj_id); } -void RenderViewHost::OnAccessibilityObjectStateChange( - const webkit_glue::WebAccessibility& acc_obj) { +void RenderViewHost::OnAccessibilityNotifications( + const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { if (view()) - view()->OnAccessibilityObjectStateChange(acc_obj); + view()->OnAccessibilityNotifications(params); - NotificationService::current()->Notify( - NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, - Source<RenderViewHost>(this), - NotificationService::NoDetails()); -} - -void RenderViewHost::OnAccessibilityObjectChildrenChange( - const std::vector<webkit_glue::WebAccessibility>& acc_changes) { - if (view()) - view()->OnAccessibilityObjectChildrenChange(acc_changes); - - if (acc_changes.size() > 0) { + if (params.size() > 0) { NotificationService::current()->Notify( NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED, Source<RenderViewHost>(this), diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 248a635..151727b 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -37,6 +37,7 @@ struct ContentSettings; struct ContextMenuParams; struct MediaPlayerAction; struct ThumbnailScore; +struct ViewHostMsg_AccessibilityNotification_Params; struct ViewHostMsg_DidPrintPage_Params; struct ViewHostMsg_DomMessage_Params; struct ViewHostMsg_RunFileChooser_Params; @@ -655,10 +656,8 @@ class RenderViewHost : public RenderWidgetHost { void OnExtensionRequest(const ViewHostMsg_DomMessage_Params& params); void OnExtensionPostMessage(int port_id, const std::string& message); void OnAccessibilityFocusChange(int acc_obj_id); - void OnAccessibilityObjectStateChange( - const webkit_glue::WebAccessibility& acc_obj); - void OnAccessibilityObjectChildrenChange( - const std::vector<webkit_glue::WebAccessibility>& acc_changes); + void OnAccessibilityNotifications( + const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params); void OnAccessibilityTree(const webkit_glue::WebAccessibility& tree); void OnCSSInserted(); void OnPageContents(const GURL& url, diff --git a/chrome/browser/renderer_host/render_widget_host.cc b/chrome/browser/renderer_host/render_widget_host.cc index 4959049..f99e57d 100644 --- a/chrome/browser/renderer_host/render_widget_host.cc +++ b/chrome/browser/renderer_host/render_widget_host.cc @@ -1174,8 +1174,8 @@ void RenderWidgetHost::AccessibilityDoDefaultAction(int acc_obj_id) { Send(new ViewMsg_AccessibilityDoDefaultAction(routing_id(), acc_obj_id)); } -void RenderWidgetHost::AccessibilityObjectChildrenChangeAck() { - Send(new ViewMsg_AccessibilityObjectChildrenChange_ACK(routing_id())); +void RenderWidgetHost::AccessibilityNotificationsAck() { + Send(new ViewMsg_AccessibilityNotifications_ACK(routing_id())); } void RenderWidgetHost::ProcessKeyboardEventAck(int type, bool processed) { diff --git a/chrome/browser/renderer_host/render_widget_host.h b/chrome/browser/renderer_host/render_widget_host.h index ad31f2e..8fcedd1 100644 --- a/chrome/browser/renderer_host/render_widget_host.h +++ b/chrome/browser/renderer_host/render_widget_host.h @@ -385,8 +385,8 @@ class RenderWidgetHost : public IPC::Channel::Listener, // on a node with this accessibility object id. void AccessibilityDoDefaultAction(int acc_obj_id); - // Acknowledges a ViewHostMsg_AccessibilityObjectChildrenChange message. - void AccessibilityObjectChildrenChangeAck(); + // Acknowledges a ViewHostMsg_AccessibilityNotifications message. + void AccessibilityNotificationsAck(); // Sets the active state (i.e., control tints). virtual void SetActive(bool active); diff --git a/chrome/browser/renderer_host/render_widget_host_view.h b/chrome/browser/renderer_host/render_widget_host_view.h index 8f64974..1dab773 100644 --- a/chrome/browser/renderer_host/render_widget_host_view.h +++ b/chrome/browser/renderer_host/render_widget_host_view.h @@ -32,6 +32,7 @@ class RenderProcessHost; class RenderWidgetHost; class VideoLayer; class WebCursor; +struct ViewHostMsg_AccessibilityNotification_Params; struct WebMenuItem; namespace webkit_glue { @@ -252,10 +253,9 @@ class RenderWidgetHostView { virtual void UpdateAccessibilityTree( const webkit_glue::WebAccessibility& tree) { } virtual void OnAccessibilityFocusChange(int acc_obj_id) { } - virtual void OnAccessibilityObjectStateChange( - const webkit_glue::WebAccessibility& acc_obj) { } - virtual void OnAccessibilityObjectChildrenChange( - const std::vector<webkit_glue::WebAccessibility>& acc_changes) { } + virtual void OnAccessibilityNotifications( + const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { + } protected: // Interface class only, do not construct. diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.cc b/chrome/browser/renderer_host/render_widget_host_view_win.cc index 04b984a..027f16f 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.cc +++ b/chrome/browser/renderer_host/render_widget_host_view_win.cc @@ -1504,19 +1504,10 @@ void RenderWidgetHostViewWin::OnAccessibilityFocusChange(int acc_obj_id) { } } -void RenderWidgetHostViewWin::OnAccessibilityObjectStateChange( - const webkit_glue::WebAccessibility& acc_obj) { - if (browser_accessibility_manager_.get()) { - browser_accessibility_manager_->OnAccessibilityObjectStateChange(acc_obj); - } -} - -void RenderWidgetHostViewWin::OnAccessibilityObjectChildrenChange( - const std::vector<webkit_glue::WebAccessibility>& acc_changes) { - if (browser_accessibility_manager_.get()) { - browser_accessibility_manager_->OnAccessibilityObjectChildrenChange( - acc_changes); - } +void RenderWidgetHostViewWin::OnAccessibilityNotifications( + const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { + if (browser_accessibility_manager_.get()) + browser_accessibility_manager_->OnAccessibilityNotifications(params); } void RenderWidgetHostViewWin::Observe(NotificationType type, @@ -1561,8 +1552,8 @@ void RenderWidgetHostViewWin::AccessibilityDoDefaultAction(int acc_obj_id) { render_widget_host_->AccessibilityDoDefaultAction(acc_obj_id); } -void RenderWidgetHostViewWin::AccessibilityObjectChildrenChangeAck() { - render_widget_host_->AccessibilityObjectChildrenChangeAck(); +void RenderWidgetHostViewWin::AccessibilityNotificationsAck() { + render_widget_host_->AccessibilityNotificationsAck(); } LRESULT RenderWidgetHostViewWin::OnGetObject(UINT message, WPARAM wparam, @@ -1592,8 +1583,13 @@ LRESULT RenderWidgetHostViewWin::OnGetObject(UINT message, WPARAM wparam, VARIANT var; var.vt = VT_I4; var.lVal = STATE_SYSTEM_BUSY; - pAccPropServices->SetHwndProp(m_hWnd, OBJID_CLIENT, - CHILDID_SELF, PROPID_ACC_STATE, var); + pAccPropServices->SetHwndProp( + m_hWnd, OBJID_CLIENT, CHILDID_SELF, PROPID_ACC_STATE, var); + + // Annotate with ROLE_SYSTEM_DOCUMENT, indicates page is a document. + var.lVal = ROLE_SYSTEM_DOCUMENT; + pAccPropServices->SetHwndProp( + m_hWnd, OBJID_CLIENT, CHILDID_SELF, PROPID_ACC_ROLE, var); } } diff --git a/chrome/browser/renderer_host/render_widget_host_view_win.h b/chrome/browser/renderer_host/render_widget_host_view_win.h index e9fc6e3..11ea7ee 100644 --- a/chrome/browser/renderer_host/render_widget_host_view_win.h +++ b/chrome/browser/renderer_host/render_widget_host_view_win.h @@ -156,10 +156,8 @@ class RenderWidgetHostViewWin virtual void UpdateAccessibilityTree( const webkit_glue::WebAccessibility& tree); virtual void OnAccessibilityFocusChange(int acc_obj_id); - virtual void OnAccessibilityObjectStateChange( - const webkit_glue::WebAccessibility& acc_obj); - virtual void OnAccessibilityObjectChildrenChange( - const std::vector<webkit_glue::WebAccessibility>& acc_obj); + virtual void OnAccessibilityNotifications( + const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params); // Implementation of NotificationObserver: virtual void Observe(NotificationType type, @@ -169,7 +167,7 @@ class RenderWidgetHostViewWin // Implementation of BrowserAccessibilityDelegate: virtual void SetAccessibilityFocus(int acc_obj_id); virtual void AccessibilityDoDefaultAction(int acc_obj_id); - virtual void AccessibilityObjectChildrenChangeAck(); + virtual void AccessibilityNotificationsAck(); protected: // Windows Message Handlers |