diff options
Diffstat (limited to 'chrome/renderer')
-rw-r--r-- | chrome/renderer/render_thread.h | 2 | ||||
-rw-r--r-- | chrome/renderer/render_view.cc | 55 | ||||
-rw-r--r-- | chrome/renderer/render_view.h | 10 |
3 files changed, 15 insertions, 52 deletions
diff --git a/chrome/renderer/render_thread.h b/chrome/renderer/render_thread.h index 680668c..f2ea2c3 100644 --- a/chrome/renderer/render_thread.h +++ b/chrome/renderer/render_thread.h @@ -261,6 +261,8 @@ class RenderThread : public RenderThreadBase, void OnGpuChannelEstablished(const IPC::ChannelHandle& channel_handle); + void OnGetAccessibilityTree(); + // Gather usage statistics from the in-memory cache and inform our host. // These functions should be call periodically so that the host can make // decisions about how to allocation resources using current information. diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc index d76a5ac..24ec489 100644 --- a/chrome/renderer/render_view.cc +++ b/chrome/renderer/render_view.cc @@ -74,7 +74,6 @@ #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,9 +635,6 @@ void RenderView::OnMessageReceived(const IPC::Message& message) { 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) @@ -684,6 +680,7 @@ void RenderView::OnMessageReceived(const IPC::Message& message) { 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)) @@ -1334,14 +1331,10 @@ void RenderView::UpdateURL(WebFrame* frame) { // 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()) { - // Remove accessibility info cache. + accessibility_->clear(); 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 @@ -3880,46 +3873,16 @@ void RenderView::OnUpdateBrowserWindowId(int window_id) { browser_window_id_ = window_id; } -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) { +void RenderView::OnGetAccessibilityTree() { + if (accessibility_.get()) { accessibility_->clear(); - return; } + accessibility_.reset(WebAccessibilityCache::create()); + accessibility_->initialize(webview()); - accessibility_->remove(acc_obj_id); - -#else // defined(OS_WIN) - // TODO(port): accessibility not yet implemented - NOTIMPLEMENTED(); -#endif + WebAccessibilityObject src_tree = webview()->accessibilityObject(); + webkit_glue::WebAccessibility dst_tree(src_tree, accessibility_.get()); + Send(new ViewHostMsg_AccessibilityTree(routing_id_, dst_tree)); } void RenderView::OnGetAllSavableResourceLinksForCurrentPage( diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h index ab2b4a4..f3429e3 100644 --- a/chrome/renderer/render_view.h +++ b/chrome/renderer/render_view.h @@ -45,6 +45,7 @@ #include "gfx/rect.h" #include "third_party/skia/include/core/SkBitmap.h" #include "testing/gtest/include/gtest/gtest_prod.h" +#include "third_party/WebKit/WebKit/chromium/public/WebAccessibilityObject.h" #include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" #include "third_party/WebKit/WebKit/chromium/public/WebContextMenuData.h" #include "third_party/WebKit/WebKit/chromium/public/WebFrameClient.h" @@ -494,6 +495,8 @@ class RenderView : public RenderWidget, // UserScript::DOCUMENT_IDLE. void OnUserScriptIdleTriggered(WebKit::WebFrame* frame); + void OnGetAccessibilityTree(); + #if defined(OS_MACOSX) // Helper routines for GPU plugin support. Used by the // WebPluginDelegateProxy, which has a pointer to the RenderView. @@ -727,10 +730,6 @@ class RenderView : public RenderWidget, void OnExecuteCode(const ViewMsg_ExecuteCode_Params& params); void ExecuteCodeImpl(WebKit::WebFrame* frame, const ViewMsg_ExecuteCode_Params& params); - void OnGetAccessibilityInfo( - const webkit_glue::WebAccessibility::InParams& in_params, - webkit_glue::WebAccessibility::OutParams* out_params); - void OnClearAccessibilityInfo(int acc_obj_id, bool clear_all); void OnExtensionMessageInvoke(const std::string& function_name, const ListValue& args, @@ -1061,11 +1060,10 @@ class RenderView : public RenderWidget, bool decrement_shared_popup_at_destruction_; // TODO(port): revisit once we have accessibility -#if defined(OS_WIN) + // Handles accessibility requests into the renderer side, as well as // maintains the cache and other features of the accessibility tree. scoped_ptr<WebKit::WebAccessibilityCache> accessibility_; -#endif // Resource message queue. Used to queue up resource IPCs if we need // to wait for an ACK from the browser before proceeding. |