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

Unified Diff: content/browser/renderer_host/render_view_host_impl.cc

Issue 12210082: content: convert accessibility notifications to observer usage (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: windows Created 7 years, 10 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
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 b9c2a29355bf436508f266ca991efd854a75c25b..e7096897917d19cd7cc2784293e1ea5865d1d843 100644
--- a/content/browser/renderer_host/render_view_host_impl.cc
+++ b/content/browser/renderer_host/render_view_host_impl.cc
@@ -1795,6 +1795,21 @@ void RenderViewHostImpl::NotifyTimezoneChange() {
Send(new ViewMsg_TimezoneChange(GetRoutingID()));
}
+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::ClearFocusedNode() {
Send(new ViewMsg_ClearFocusedNode(GetRoutingID()));
}
@@ -1892,17 +1907,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()));

Powered by Google App Engine
This is Rietveld 408576698