Index: content/browser/renderer_host/render_view_host_impl.cc |
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc |
index 3bc3b3c1229819903fb3e30221414f53f3cbb5e0..e13557a3b898d60fc8aad9840d9be5ee03cdd59a 100644 |
--- a/content/browser/renderer_host/render_view_host_impl.cc |
+++ b/content/browser/renderer_host/render_view_host_impl.cc |
@@ -175,6 +175,9 @@ RenderViewHostImpl::RenderViewHostImpl( |
has_timed_out_on_unload_(false), |
unload_ack_is_for_cross_site_transition_(false), |
are_javascript_messages_suppressed_(false), |
+ accessibility_layout_callback_(base::Bind(&base::DoNothing)), |
+ accessibility_load_callback_(base::Bind(&base::DoNothing)), |
+ accessibility_other_callback_(base::Bind(&base::DoNothing)), |
sudden_termination_allowed_(false), |
session_storage_namespace_( |
static_cast<SessionStorageNamespaceImpl*>(session_storage)), |
@@ -1782,6 +1785,21 @@ void RenderViewHostImpl::UpdateFrameTree( |
frame_tree_)); |
} |
+void RenderViewHostImpl::SetAccessibilityLayoutCompleteCallbackForTesting( |
+ const base::Closure& callback) { |
+ accessibility_layout_callback_ = callback; |
+} |
+ |
+void RenderViewHostImpl::SetAccessibilityLoadCompleteCallbackForTesting( |
+ const base::Closure& callback) { |
+ accessibility_load_callback_ = callback; |
+} |
+ |
+void RenderViewHostImpl::SetAccessibilityOtherCallbackForTesting( |
+ const base::Closure& callback) { |
+ accessibility_other_callback_ = callback; |
+} |
+ |
void RenderViewHostImpl::UpdateWebkitPreferences( |
const webkit_glue::WebPreferences& prefs) { |
Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); |
@@ -1888,17 +1906,13 @@ void RenderViewHostImpl::OnAccessibilityNotifications( |
accessibility_tree_ = param.acc_tree; |
} |
- NotificationType dst_type; |
- if (src_type == AccessibilityNotificationLoadComplete) |
- dst_type = NOTIFICATION_ACCESSIBILITY_LOAD_COMPLETE; |
- else if (src_type == AccessibilityNotificationLayoutComplete) |
- dst_type = NOTIFICATION_ACCESSIBILITY_LAYOUT_COMPLETE; |
- else |
- dst_type = NOTIFICATION_ACCESSIBILITY_OTHER; |
- NotificationService::current()->Notify( |
- dst_type, |
- Source<RenderViewHost>(this), |
- NotificationService::NoDetails()); |
+ if (src_type == AccessibilityNotificationLayoutComplete) { |
+ accessibility_layout_callback_.Run(); |
+ } else if (src_type == AccessibilityNotificationLoadComplete) { |
+ accessibility_load_callback_.Run(); |
+ } else { |
+ accessibility_other_callback_.Run(); |
+ } |
} |
Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID())); |