Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(137)

Unified Diff: chrome/renderer/render_view.cc

Issue 2121004: Windows accessibility improvements: 1. All WebKit roles are now passed to the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/render_view.h ('k') | webkit/glue/webaccessibility.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 47913)
+++ chrome/renderer/render_view.cc (working copy)
@@ -685,6 +685,9 @@
IPC_MESSAGE_HANDLER(ViewMsg_TranslatePage, OnTranslatePage)
IPC_MESSAGE_HANDLER(ViewMsg_RevertTranslation, OnRevertTranslation)
IPC_MESSAGE_HANDLER(ViewMsg_GetAccessibilityTree, OnGetAccessibilityTree)
+ IPC_MESSAGE_HANDLER(ViewMsg_SetAccessibilityFocus, OnSetAccessibilityFocus)
+ IPC_MESSAGE_HANDLER(ViewMsg_AccessibilityDoDefaultAction,
+ OnAccessibilityDoDefaultAction)
// Have the super handle all other messages.
IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message))
@@ -3929,9 +3932,8 @@
}
void RenderView::OnGetAccessibilityTree() {
- if (accessibility_.get()) {
+ if (accessibility_.get())
accessibility_->clear();
- }
accessibility_.reset(WebAccessibilityCache::create());
accessibility_->initialize(webview());
@@ -3940,6 +3942,29 @@
Send(new ViewHostMsg_AccessibilityTree(routing_id_, dst_tree));
}
+void RenderView::OnSetAccessibilityFocus(int acc_obj_id) {
+ if (!accessibility_.get())
+ return;
+ if (accessibility_->isValidId(acc_obj_id)) {
+ // TODO(dmazzoni) fix the cache so that id=1000 is not a magic number.
+ // By convention, calling SetFocus on the root of the tree (id = 1000)
+ // should clear the current focus. Otherwise set the focus to the new
+ // node.
+ if (acc_obj_id == 1000)
+ webview()->clearFocusedNode();
+ else
+ accessibility_->getObjectById(acc_obj_id).setFocused(true);
+ }
+}
+
+void RenderView::OnAccessibilityDoDefaultAction(int acc_obj_id) {
+ if (!accessibility_.get())
+ return;
+ if (accessibility_->isValidId(acc_obj_id)) {
+ accessibility_->getObjectById(acc_obj_id).performDefaultAction();
+ }
+}
+
void RenderView::OnGetAllSavableResourceLinksForCurrentPage(
const GURL& page_url) {
// Prepare list to storage all savable resource links.
« no previous file with comments | « chrome/renderer/render_view.h ('k') | webkit/glue/webaccessibility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698