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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 830053004: Suppress accessibility events when user is navigating away. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index a6a7c488357c29203be043f2c9003eb563eb9353..e15b67cd10d93bb665bf318f4b1b871c554fcd34 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2502,6 +2502,11 @@ void WebContentsImpl::DidFailProvisionalLoadWithError(
validated_url,
params.error_code,
params.error_description));
+
+ BrowserAccessibilityManager* manager =
nasko 2015/02/03 17:28:05 nit: wrong indent.
dmazzoni 2015/02/04 20:56:06 Done.
+ render_frame_host->browser_accessibility_manager();
+ if (manager)
+ manager->NavigationFailed();
}
void WebContentsImpl::DidFailLoadWithError(
@@ -2538,6 +2543,16 @@ void WebContentsImpl::DidStartNavigationToPendingEntry(
WebContentsObserver,
observers_,
DidStartNavigationToPendingEntry(url, reload_type));
+
+ // Notify accessibility that the user is navigating away from the
+ // current RenderFrameHost.
+ FrameTreeNode* ftn = render_frame_host->frame_tree_node();
dmazzoni 2015/01/21 18:59:04 This is the only function that gets called early e
nasko 2015/02/03 17:28:05 Architecturally, we can't notify before commit tim
dmazzoni 2015/02/03 17:40:54 What I'm observing is that for a browser-initiated
nasko 2015/02/03 18:05:18 What you are observing is correct for this very sp
dmazzoni 2015/02/03 18:20:27 That's true. The point is that I need a notificat
+ BrowserAccessibilityManager* manager =
+ ftn->current_frame_host()->browser_accessibility_manager();
+ if (manager) {
+ bool is_reload = reload_type != NavigationController::NO_RELOAD;
+ manager->UserIsNavigatingAway(is_reload);
+ }
}
void WebContentsImpl::RequestOpenURL(RenderFrameHostImpl* render_frame_host,
@@ -2576,6 +2591,11 @@ void WebContentsImpl::DidCommitProvisionalLoad(
observers_,
DidCommitProvisionalLoadForFrame(
render_frame_host, url, transition_type));
+
+ BrowserAccessibilityManager* manager =
+ render_frame_host->browser_accessibility_manager();
+ if (manager)
+ manager->NavigationSucceeded();
}
void WebContentsImpl::DidNavigateMainFramePreCommit(

Powered by Google App Engine
This is Rietveld 408576698