Index: content/renderer/render_view.cc |
=================================================================== |
--- content/renderer/render_view.cc (revision 98225) |
+++ content/renderer/render_view.cc (working copy) |
@@ -276,6 +276,10 @@ |
WebAccessibilityNotification notification, |
ViewHostMsg_AccessibilityNotification_Type::Value* type) { |
switch (notification) { |
+ case WebKit::WebAccessibilityNotificationActiveDescendantChanged: |
+ *type = ViewHostMsg_AccessibilityNotification_Type:: |
+ NOTIFICATION_TYPE_ACTIVE_DESCENDANT_CHANGED; |
+ break; |
case WebKit::WebAccessibilityNotificationCheckedStateChanged: |
*type = ViewHostMsg_AccessibilityNotification_Type:: |
NOTIFICATION_TYPE_CHECK_STATE_CHANGED; |
@@ -288,20 +292,51 @@ |
*type = ViewHostMsg_AccessibilityNotification_Type:: |
NOTIFICATION_TYPE_FOCUS_CHANGED; |
break; |
+ case WebKit::WebAccessibilityNotificationLayoutComplete: |
+ *type = ViewHostMsg_AccessibilityNotification_Type:: |
+ NOTIFICATION_TYPE_LAYOUT_COMPLETE; |
+ break; |
case WebKit::WebAccessibilityNotificationLoadComplete: |
*type = ViewHostMsg_AccessibilityNotification_Type:: |
NOTIFICATION_TYPE_LOAD_COMPLETE; |
break; |
- case WebKit::WebAccessibilityNotificationValueChanged: |
+ case WebKit::WebAccessibilityNotificationSelectedChildrenChanged: |
*type = ViewHostMsg_AccessibilityNotification_Type:: |
- NOTIFICATION_TYPE_VALUE_CHANGED; |
+ NOTIFICATION_TYPE_SELECTED_CHILDREN_CHANGED; |
break; |
case WebKit::WebAccessibilityNotificationSelectedTextChanged: |
*type = ViewHostMsg_AccessibilityNotification_Type:: |
NOTIFICATION_TYPE_SELECTED_TEXT_CHANGED; |
break; |
+ case WebKit::WebAccessibilityNotificationValueChanged: |
+ *type = ViewHostMsg_AccessibilityNotification_Type:: |
+ NOTIFICATION_TYPE_VALUE_CHANGED; |
+ break; |
+ case WebKit::WebAccessibilityNotificationScrolledToAnchor: |
+ *type = ViewHostMsg_AccessibilityNotification_Type:: |
+ NOTIFICATION_TYPE_SCROLLED_TO_ANCHOR; |
+ break; |
+ case WebKit::WebAccessibilityNotificationLiveRegionChanged: |
+ *type = ViewHostMsg_AccessibilityNotification_Type:: |
+ NOTIFICATION_TYPE_LIVE_REGION_CHANGED; |
+ break; |
+ case WebKit::WebAccessibilityNotificationMenuListValueChanged: |
+ *type = ViewHostMsg_AccessibilityNotification_Type:: |
+ NOTIFICATION_TYPE_MENU_LIST_VALUE_CHANGED; |
+ break; |
+ case WebKit::WebAccessibilityNotificationRowCountChanged: |
+ *type = ViewHostMsg_AccessibilityNotification_Type:: |
+ NOTIFICATION_TYPE_ROW_COUNT_CHANGED; |
+ break; |
+ case WebKit::WebAccessibilityNotificationRowCollapsed: |
+ *type = ViewHostMsg_AccessibilityNotification_Type:: |
+ NOTIFICATION_TYPE_ROW_COLLAPSED; |
+ break; |
+ case WebKit::WebAccessibilityNotificationRowExpanded: |
+ *type = ViewHostMsg_AccessibilityNotification_Type:: |
+ NOTIFICATION_TYPE_ROW_EXPANDED; |
+ break; |
default: |
- // TODO(ctguil): Support additional webkit notifications. |
return false; |
} |
return true; |
@@ -365,6 +400,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), |
@@ -414,6 +450,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 P2PSocketDispatcher(this); |
@@ -528,7 +566,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; |
@@ -1596,16 +1635,23 @@ |
for (size_t i = 0; i < pending_accessibility_notifications_.size(); i++) { |
RendererAccessibilityNotification& notification = |
pending_accessibility_notifications_[i]; |
- WebAccessibilityObject obj = accessibility_->getObjectById(notification.id); |
+ WebAccessibilityObject obj = accessibility_->getObjectById( |
+ notification.id); |
if (!obj.isValid()) |
continue; |
ViewHostMsg_AccessibilityNotification_Params param; |
WebAccessibilityNotificationToViewHostMsg( |
- pending_accessibility_notifications_[i].type, ¶m.notification_type); |
+ pending_accessibility_notifications_[i].type, |
+ ¶m.notification_type); |
param.acc_obj = WebAccessibility( |
obj, accessibility_.get(), notification.ShouldIncludeChildren()); |
notifications.push_back(param); |
+ |
+ if (accessibility_logging_) { |
+ LOG(INFO) << "Accessibility update: \n" |
David Tseng
2011/08/29 19:05:34
Might be useful to also output
|param.notification
|
+ << param.acc_obj.DebugString(true); |
+ } |
} |
pending_accessibility_notifications_.clear(); |
Send(new ViewHostMsg_AccessibilityNotifications(routing_id_, notifications)); |