Index: chrome/renderer/render_view.cc |
=================================================================== |
--- chrome/renderer/render_view.cc (revision 46846) |
+++ chrome/renderer/render_view.cc (working copy) |
@@ -75,6 +75,7 @@ |
#include "skia/ext/image_operations.h" |
#include "third_party/cld/encodings/compact_lang_det/win/cld_unicodetext.h" |
#include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityCache.h" |
+#include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityObject.h" |
#include "third_party/WebKit/WebKit/chromium/public/WebCString.h" |
#include "third_party/WebKit/WebKit/chromium/public/WebDataSource.h" |
#include "third_party/WebKit/WebKit/chromium/public/WebDevToolsAgent.h" |
@@ -636,6 +637,9 @@ |
ViewMsg_GetSerializedHtmlDataForCurrentPageWithLocalLinks, |
OnGetSerializedHtmlDataForCurrentPageWithLocalLinks) |
IPC_MESSAGE_HANDLER(ViewMsg_GetApplicationInfo, OnGetApplicationInfo) |
+ IPC_MESSAGE_HANDLER(ViewMsg_GetAccessibilityInfo, OnGetAccessibilityInfo) |
+ IPC_MESSAGE_HANDLER(ViewMsg_ClearAccessibilityInfo, |
+ OnClearAccessibilityInfo) |
IPC_MESSAGE_HANDLER(ViewMsg_ShouldClose, OnMsgShouldClose) |
IPC_MESSAGE_HANDLER(ViewMsg_ClosePage, OnClosePage) |
IPC_MESSAGE_HANDLER(ViewMsg_ThemeChanged, OnThemeChanged) |
@@ -681,7 +685,6 @@ |
OnCustomContextMenuAction) |
IPC_MESSAGE_HANDLER(ViewMsg_TranslatePage, OnTranslatePage) |
IPC_MESSAGE_HANDLER(ViewMsg_RevertTranslation, OnRevertTranslation) |
- IPC_MESSAGE_HANDLER(ViewMsg_GetAccessibilityTree, OnGetAccessibilityTree) |
// Have the super handle all other messages. |
IPC_MESSAGE_UNHANDLED(RenderWidget::OnMessageReceived(message)) |
@@ -1332,10 +1335,14 @@ |
// we don't want the transition type to persist. Just clear it. |
navigation_state->set_transition_type(PageTransition::LINK); |
+#if defined(OS_WIN) |
if (accessibility_.get()) { |
- accessibility_->clear(); |
+ // Remove accessibility info cache. |
accessibility_.reset(); |
} |
+#else |
+ // TODO(port): accessibility not yet implemented. See http://crbug.com/8288. |
+#endif |
} |
// Tell the embedding application that the title of the active page has changed |
@@ -3922,16 +3929,46 @@ |
browser_window_id_ = window_id; |
} |
-void RenderView::OnGetAccessibilityTree() { |
- if (accessibility_.get()) { |
+void RenderView::OnGetAccessibilityInfo( |
+ const webkit_glue::WebAccessibility::InParams& in_params, |
+ webkit_glue::WebAccessibility::OutParams* out_params) { |
+#if defined(OS_WIN) |
+ if (!accessibility_.get()) { |
+ // TODO(dglazkov): Once implemented for all ports, remove lazy |
+ // instantiation of accessibility_. |
+ accessibility_.reset(WebAccessibilityCache::create()); |
+ accessibility_->initialize(webview()); |
+ } |
+ |
+ out_params->return_code = |
+ webkit_glue::WebAccessibility::GetAccObjInfo(accessibility_.get(), |
+ in_params, |
+ out_params); |
+ |
+#else // defined(OS_WIN) |
+ // TODO(port): accessibility not yet implemented |
+ NOTIMPLEMENTED(); |
+#endif |
+} |
+ |
+void RenderView::OnClearAccessibilityInfo(int acc_obj_id, bool clear_all) { |
+#if defined(OS_WIN) |
+ if (!accessibility_.get()) { |
+ // If accessibility is not activated, ignore clearing message. |
+ return; |
+ } |
+ |
+ if (clear_all) { |
accessibility_->clear(); |
+ return; |
} |
- accessibility_.reset(WebAccessibilityCache::create()); |
- accessibility_->initialize(webview()); |
- WebAccessibilityObject src_tree = webview()->accessibilityObject(); |
- webkit_glue::WebAccessibility dst_tree(src_tree, accessibility_.get()); |
- Send(new ViewHostMsg_AccessibilityTree(routing_id_, dst_tree)); |
+ accessibility_->remove(acc_obj_id); |
+ |
+#else // defined(OS_WIN) |
+ // TODO(port): accessibility not yet implemented |
+ NOTIMPLEMENTED(); |
+#endif |
} |
void RenderView::OnGetAllSavableResourceLinksForCurrentPage( |