summaryrefslogtreecommitdiffstats
path: root/chrome/common/render_messages.h
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-11 14:31:09 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-11 14:31:09 +0000
commitb3df5a4b6ea1c145a0945f2dca73c073ed53dae0 (patch)
treebb4dc38a4ed280f63fec773a48d78e374f5ba158 /chrome/common/render_messages.h
parentfaf2ee4705a9e0c154d57cb7daeb0157431d8103 (diff)
downloadchromium_src-b3df5a4b6ea1c145a0945f2dca73c073ed53dae0.zip
chromium_src-b3df5a4b6ea1c145a0945f2dca73c073ed53dae0.tar.gz
chromium_src-b3df5a4b6ea1c145a0945f2dca73c073ed53dae0.tar.bz2
Reimplement accessibility of web content by caching the entire
accessibility tree in the browser process. Adds new RPCs for a browser tab to request accessibility info from a renderer; the renderer responds with a complete tree of accessibility metadata for the entire DOM, which is then cached in the RenderWidgetHostView. This part is cross-platform and will help with accessibility on both Windows and Mac OS X. For Windows, MSAA support for web content has been rewritten to use this new cache. Tested in JAWS and NVDA screen readers. Using Chrome with a screen reader is now fast and stable, unlike the previous implementation. However, note that most advanced functionality is still not supported, and much work remains to make Chrome work well with a screen reader. This is a necessary step to improve stability first. BUG=25564 BUG=13291 TEST=See http://codereview.chromium.org/1806001 Review URL: http://codereview.chromium.org/1637018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46916 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/render_messages.h')
-rw-r--r--chrome/common/render_messages.h141
1 files changed, 66 insertions, 75 deletions
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index 3770fe2..7f6ce16 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -711,80 +711,6 @@ struct ParamTraits<FilterPolicy::Type> {
};
template <>
-struct ParamTraits<webkit_glue::WebAccessibility::InParams> {
- typedef webkit_glue::WebAccessibility::InParams param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.object_id);
- WriteParam(m, p.function_id);
- WriteParam(m, p.child_id);
- WriteParam(m, p.input_long1);
- WriteParam(m, p.input_long2);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->object_id) &&
- ReadParam(m, iter, &p->function_id) &&
- ReadParam(m, iter, &p->child_id) &&
- ReadParam(m, iter, &p->input_long1) &&
- ReadParam(m, iter, &p->input_long2);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"(");
- LogParam(p.object_id, l);
- l->append(L", ");
- LogParam(p.function_id, l);
- l->append(L", ");
- LogParam(p.child_id, l);
- l->append(L", ");
- LogParam(p.input_long1, l);
- l->append(L", ");
- LogParam(p.input_long2, l);
- l->append(L")");
- }
-};
-
-template <>
-struct ParamTraits<webkit_glue::WebAccessibility::OutParams> {
- typedef webkit_glue::WebAccessibility::OutParams param_type;
- static void Write(Message* m, const param_type& p) {
- WriteParam(m, p.object_id);
- WriteParam(m, p.output_long1);
- WriteParam(m, p.output_long2);
- WriteParam(m, p.output_long3);
- WriteParam(m, p.output_long4);
- WriteParam(m, p.output_string);
- WriteParam(m, p.return_code);
- }
- static bool Read(const Message* m, void** iter, param_type* p) {
- return
- ReadParam(m, iter, &p->object_id) &&
- ReadParam(m, iter, &p->output_long1) &&
- ReadParam(m, iter, &p->output_long2) &&
- ReadParam(m, iter, &p->output_long3) &&
- ReadParam(m, iter, &p->output_long4) &&
- ReadParam(m, iter, &p->output_string) &&
- ReadParam(m, iter, &p->return_code);
- }
- static void Log(const param_type& p, std::wstring* l) {
- l->append(L"(");
- LogParam(p.object_id, l);
- l->append(L", ");
- LogParam(p.output_long1, l);
- l->append(L", ");
- LogParam(p.output_long2, l);
- l->append(L", ");
- LogParam(p.output_long3, l);
- l->append(L", ");
- LogParam(p.output_long4, l);
- l->append(L", ");
- LogParam(p.output_string, l);
- l->append(L", ");
- LogParam(p.return_code, l);
- l->append(L")");
- }
-};
-
-template <>
struct ParamTraits<ViewHostMsg_ImeControl> {
typedef ViewHostMsg_ImeControl param_type;
static void Write(Message* m, const param_type& p) {
@@ -2668,8 +2594,73 @@ struct ParamTraits<WindowContainerType> {
}
};
-} // namespace IPC
+template <>
+struct ParamTraits<webkit_glue::WebAccessibility> {
+ typedef webkit_glue::WebAccessibility param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.id);
+ WriteParam(m, p.name);
+ WriteParam(m, p.value);
+ WriteParam(m, p.action);
+ WriteParam(m, p.description);
+ WriteParam(m, p.help);
+ WriteParam(m, p.shortcut);
+ WriteParam(m, static_cast<int>(p.role));
+ WriteParam(m, static_cast<int>(p.state));
+ WriteParam(m, p.location);
+ WriteParam(m, p.children);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ bool ret = ReadParam(m, iter, &p->id);
+ ret = ret && ReadParam(m, iter, &p->name);
+ ret = ret && ReadParam(m, iter, &p->value);
+ ret = ret && ReadParam(m, iter, &p->action);
+ ret = ret && ReadParam(m, iter, &p->description);
+ ret = ret && ReadParam(m, iter, &p->help);
+ ret = ret && ReadParam(m, iter, &p->shortcut);
+ int role = -1;
+ ret = ret && ReadParam(m, iter, &role);
+ if (role >= webkit_glue::WebAccessibility::ROLE_NONE &&
+ role < webkit_glue::WebAccessibility::NUM_ROLES) {
+ p->role = static_cast<webkit_glue::WebAccessibility::Role>(role);
+ } else {
+ p->role = webkit_glue::WebAccessibility::ROLE_NONE;
+ }
+ int state = 0;
+ ret = ret && ReadParam(m, iter, &state);
+ p->state = static_cast<webkit_glue::WebAccessibility::State>(state);
+ ret = ret && ReadParam(m, iter, &p->location);
+ ret = ret && ReadParam(m, iter, &p->children);
+ return ret;
+ }
+ static void Log(const param_type& p, std::wstring* l) {
+ l->append(L"(");
+ LogParam(p.id, l);
+ l->append(L", ");
+ LogParam(p.name, l);
+ l->append(L", ");
+ LogParam(p.value, l);
+ l->append(L", ");
+ LogParam(p.action, l);
+ l->append(L", ");
+ LogParam(p.description, l);
+ l->append(L", ");
+ LogParam(p.help, l);
+ l->append(L", ");
+ LogParam(p.shortcut, l);
+ l->append(L", ");
+ LogParam(static_cast<int>(p.role), l);
+ l->append(L", ");
+ LogParam(static_cast<int>(p.state), l);
+ l->append(L", ");
+ LogParam(p.location, l);
+ l->append(L", ");
+ LogParam(p.children, l);
+ l->append(L")");
+ }
+};
+} // namespace IPC
#define MESSAGES_INTERNAL_FILE "chrome/common/render_messages_internal.h"
#include "ipc/ipc_message_macros.h"