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

Unified Diff: content/renderer/render_view.cc

Issue 7745035: Add a big grab bag of missing web accessibility functionality... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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 | « content/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: content/renderer/render_view.cc
===================================================================
--- content/renderer/render_view.cc (revision 98956)
+++ content/renderer/render_view.cc (working copy)
@@ -278,34 +278,54 @@
static bool WebAccessibilityNotificationToViewHostMsg(
WebAccessibilityNotification notification,
- ViewHostMsg_AccessibilityNotification_Type::Value* type) {
+ ViewHostMsg_AccEvent::Value* type) {
switch (notification) {
+ case WebKit::WebAccessibilityNotificationActiveDescendantChanged:
+ *type = ViewHostMsg_AccEvent::ACTIVE_DESCENDANT_CHANGED;
+ break;
case WebKit::WebAccessibilityNotificationCheckedStateChanged:
- *type = ViewHostMsg_AccessibilityNotification_Type::
- NOTIFICATION_TYPE_CHECK_STATE_CHANGED;
+ *type = ViewHostMsg_AccEvent::CHECK_STATE_CHANGED;
break;
case WebKit::WebAccessibilityNotificationChildrenChanged:
- *type = ViewHostMsg_AccessibilityNotification_Type::
- NOTIFICATION_TYPE_CHILDREN_CHANGED;
+ *type = ViewHostMsg_AccEvent::CHILDREN_CHANGED;
break;
case WebKit::WebAccessibilityNotificationFocusedUIElementChanged:
- *type = ViewHostMsg_AccessibilityNotification_Type::
- NOTIFICATION_TYPE_FOCUS_CHANGED;
+ *type = ViewHostMsg_AccEvent::FOCUS_CHANGED;
break;
+ case WebKit::WebAccessibilityNotificationLayoutComplete:
+ *type = ViewHostMsg_AccEvent::LAYOUT_COMPLETE;
+ break;
+ case WebKit::WebAccessibilityNotificationLiveRegionChanged:
+ *type = ViewHostMsg_AccEvent::LIVE_REGION_CHANGED;
+ break;
case WebKit::WebAccessibilityNotificationLoadComplete:
- *type = ViewHostMsg_AccessibilityNotification_Type::
- NOTIFICATION_TYPE_LOAD_COMPLETE;
+ *type = ViewHostMsg_AccEvent::LOAD_COMPLETE;
break;
- case WebKit::WebAccessibilityNotificationValueChanged:
- *type = ViewHostMsg_AccessibilityNotification_Type::
- NOTIFICATION_TYPE_VALUE_CHANGED;
+ case WebKit::WebAccessibilityNotificationMenuListValueChanged:
+ *type = ViewHostMsg_AccEvent::MENU_LIST_VALUE_CHANGED;
break;
+ case WebKit::WebAccessibilityNotificationRowCollapsed:
+ *type = ViewHostMsg_AccEvent::ROW_COLLAPSED;
+ break;
+ case WebKit::WebAccessibilityNotificationRowCountChanged:
+ *type = ViewHostMsg_AccEvent::ROW_COUNT_CHANGED;
+ break;
+ case WebKit::WebAccessibilityNotificationRowExpanded:
+ *type = ViewHostMsg_AccEvent::ROW_EXPANDED;
+ break;
+ case WebKit::WebAccessibilityNotificationScrolledToAnchor:
+ *type = ViewHostMsg_AccEvent::SCROLLED_TO_ANCHOR;
+ break;
+ case WebKit::WebAccessibilityNotificationSelectedChildrenChanged:
+ *type = ViewHostMsg_AccEvent::SELECTED_CHILDREN_CHANGED;
+ break;
case WebKit::WebAccessibilityNotificationSelectedTextChanged:
- *type = ViewHostMsg_AccessibilityNotification_Type::
- NOTIFICATION_TYPE_SELECTED_TEXT_CHANGED;
+ *type = ViewHostMsg_AccEvent::SELECTED_TEXT_CHANGED;
break;
+ case WebKit::WebAccessibilityNotificationValueChanged:
+ *type = ViewHostMsg_AccEvent::VALUE_CHANGED;
+ break;
default:
- // TODO(ctguil): Support additional webkit notifications.
return false;
}
return true;
@@ -369,6 +389,7 @@
speech_input_dispatcher_(NULL),
device_orientation_dispatcher_(NULL),
accessibility_ack_pending_(false),
+ accessibility_logging_(false),
p2p_socket_dispatcher_(NULL),
devtools_agent_(NULL),
session_storage_namespace_id_(session_storage_namespace_id),
@@ -416,6 +437,8 @@
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
if (command_line.HasSwitch(switches::kEnableAccessibility))
WebAccessibilityCache::enableAccessibility();
+ if (command_line.HasSwitch(switches::kEnableAccessibilityLogging))
+ accessibility_logging_ = true;
#if defined(ENABLE_P2P_APIS)
p2p_socket_dispatcher_ = new content::P2PSocketDispatcher(this);
@@ -530,7 +553,8 @@
bool RenderView::RendererAccessibilityNotification::ShouldIncludeChildren() {
typedef ViewHostMsg_AccessibilityNotification_Params params;
if (type == WebKit::WebAccessibilityNotificationChildrenChanged ||
- type == WebKit::WebAccessibilityNotificationLoadComplete) {
+ type == WebKit::WebAccessibilityNotificationLoadComplete ||
+ type == WebKit::WebAccessibilityNotificationLiveRegionChanged) {
return true;
}
return false;
@@ -1624,6 +1648,13 @@
param.acc_obj = WebAccessibility(
obj, accessibility_.get(), notification.ShouldIncludeChildren());
notifications.push_back(param);
+
+#ifndef NDEBUG
+ if (accessibility_logging_) {
+ LOG(INFO) << "Accessibility update: \n"
+ << param.acc_obj.DebugString(true);
+ }
+#endif
}
pending_accessibility_notifications_.clear();
Send(new ViewHostMsg_AccessibilityNotifications(routing_id_, notifications));
@@ -4139,7 +4170,7 @@
if (acc_notification.id < 0)
return;
- ViewHostMsg_AccessibilityNotification_Type::Value temp;
+ ViewHostMsg_AccEvent::Value temp;
if (!WebAccessibilityNotificationToViewHostMsg(notification, &temp))
return;
« no previous file with comments | « content/renderer/render_view.h ('k') | webkit/glue/webaccessibility.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698