summaryrefslogtreecommitdiffstats
path: root/chrome/renderer
diff options
context:
space:
mode:
authorklink@chromium.org <klink@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-30 23:56:50 +0000
committerklink@chromium.org <klink@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2008-09-30 23:56:50 +0000
commit266eb6ff422cf97eef1e56e78d0a9e73e9aef34a (patch)
treee2534c18efb1e38683a0b835956d2c067df7f6be /chrome/renderer
parenteed46c091b85924b097a5d506b3da6371b93007f (diff)
downloadchromium_src-266eb6ff422cf97eef1e56e78d0a9e73e9aef34a.zip
chromium_src-266eb6ff422cf97eef1e56e78d0a9e73e9aef34a.tar.gz
chromium_src-266eb6ff422cf97eef1e56e78d0a9e73e9aef34a.tar.bz2
Adds MSAA/IAccessible exposure of web content.
Review URL: http://codereview.chromium.org/4057 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2738 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer')
-rw-r--r--chrome/renderer/render_view.cc39
-rw-r--r--chrome/renderer/render_view.h8
2 files changed, 43 insertions, 4 deletions
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 636fc54..af907c1 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -310,7 +310,8 @@ void RenderView::OnMessageReceived(const IPC::Message& message) {
OnAllowDomAutomationBindings)
IPC_MESSAGE_HANDLER(ViewMsg_AllowBindings, OnAllowBindings)
IPC_MESSAGE_HANDLER(ViewMsg_SetDOMUIProperty, OnSetDOMUIProperty)
- IPC_MESSAGE_HANDLER(ViewMsg_DragSourceEndedOrMoved, OnDragSourceEndedOrMoved)
+ IPC_MESSAGE_HANDLER(ViewMsg_DragSourceEndedOrMoved,
+ OnDragSourceEndedOrMoved)
IPC_MESSAGE_HANDLER(ViewMsg_DragSourceSystemDragEnded,
OnDragSourceSystemDragEnded)
IPC_MESSAGE_HANDLER(ViewMsg_SetInitialFocus, OnSetInitialFocus)
@@ -328,6 +329,9 @@ void RenderView::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(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)
@@ -1051,6 +1055,11 @@ void RenderView::UpdateURL(WebFrame* frame) {
// we don't want the transition type to persist.
if (extra_data)
extra_data->transition_type = PageTransition::LINK; // Just clear it.
+
+ if (glue_accessibility_.get()) {
+ // Clear accessibility info cache.
+ glue_accessibility_->ClearIAccessibleMap(-1, true);
+ }
}
// Tell the embedding application that the title of the active page has changed
@@ -1146,7 +1155,7 @@ void RenderView::DidStartProvisionalLoadForFrame(
NavigationGesture gesture) {
if (webview->GetMainFrame() == frame) {
navigation_gesture_ = gesture;
-
+
// Make sure redirect tracking state is clear for the new load.
completed_client_redirect_src_ = GURL();
}
@@ -2260,8 +2269,7 @@ void RenderView::OnAllowDomAutomationBindings(bool allow_bindings) {
}
void RenderView::OnAllowBindings(bool enable_dom_ui_bindings,
- bool enable_external_host_bindings)
-{
+ bool enable_external_host_bindings) {
enable_dom_ui_bindings_ = enable_dom_ui_bindings;
enable_external_host_bindings_ = enable_external_host_bindings;
}
@@ -2406,6 +2414,29 @@ void RenderView::OnUpdateBackForwardListCount(int back_list_count,
history_forward_list_count_ = forward_list_count;
}
+void RenderView::OnGetAccessibilityInfo(
+ const ViewMsg_Accessibility_In_Params& in_params,
+ ViewHostMsg_Accessibility_Out_Params* out_params) {
+
+ if (!glue_accessibility_.get())
+ glue_accessibility_.reset(new GlueAccessibility());
+
+ if (!glue_accessibility_->
+ GetAccessibilityInfo(webview(), in_params, out_params)) {
+ return;
+ }
+}
+
+void RenderView::OnClearAccessibilityInfo(int iaccessible_id, bool clear_all) {
+ if (!glue_accessibility_.get()) {
+ // If accessibility is not activated, ignore clearing message.
+ return;
+ }
+
+ if (!glue_accessibility_->ClearIAccessibleMap(iaccessible_id, clear_all))
+ return;
+}
+
void RenderView::OnGetAllSavableResourceLinksForCurrentPage(
const GURL& page_url) {
// Prepare list to storage all savable resource links.
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 6f6b9c3..71faf63 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -26,6 +26,7 @@
#include "chrome/renderer/render_widget.h"
#include "webkit/glue/console_message_level.h"
#include "webkit/glue/dom_serializer_delegate.h"
+#include "webkit/glue/glue_accessibility.h"
#include "webkit/glue/webview_delegate.h"
#include "webkit/glue/webview.h"
@@ -418,6 +419,9 @@ class RenderView : public RenderWidget, public WebViewDelegate,
void OnEnableViewSourceMode();
void OnUpdateBackForwardListCount(int back_list_count,
int forward_list_count);
+ void OnGetAccessibilityInfo(const ViewMsg_Accessibility_In_Params& in_params,
+ ViewHostMsg_Accessibility_Out_Params* out_params);
+ void OnClearAccessibilityInfo(int iaccessible_id, bool clear_all);
// Checks if the RenderView should close, runs the beforeunload handler and
// sends ViewMsg_ShouldClose to the browser.
@@ -612,6 +616,10 @@ class RenderView : public RenderWidget, public WebViewDelegate,
// True if the page has any frame-level unload or beforeunload listeners.
bool has_unload_listener_;
+ // Handles accessibility requests into the renderer side, as well as
+ // maintains the cache and other features of the accessibility tree.
+ scoped_ptr<GlueAccessibility> glue_accessibility_;
+
DISALLOW_EVIL_CONSTRUCTORS(RenderView);
};