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

Unified Diff: content/browser/frame_host/render_frame_host_manager.cc

Issue 746993003: Only cancel navigation on user gesture (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: documentation and style fixes Created 6 years 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/frame_host/render_frame_host_manager.cc
diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
index 06ab825123e4b1fd294dd577e6aee18ab9ff94fe..807a450985156f6c5d4c97e5f611d53bb71f983c 100644
--- a/content/browser/frame_host/render_frame_host_manager.cc
+++ b/content/browser/frame_host/render_frame_host_manager.cc
@@ -418,7 +418,8 @@ void RenderFrameHostManager::ClearNavigationTransitionData() {
}
void RenderFrameHostManager::DidNavigateFrame(
- RenderFrameHostImpl* render_frame_host) {
+ RenderFrameHostImpl* render_frame_host,
+ bool was_caused_by_user_gesture) {
if (!cross_navigation_pending_) {
DCHECK(!pending_render_frame_host_);
@@ -436,10 +437,14 @@ void RenderFrameHostManager::DidNavigateFrame(
CommitPending();
cross_navigation_pending_ = false;
} else if (render_frame_host == render_frame_host_) {
- // A navigation in the original page has taken place. Cancel the pending
- // one.
- CancelPending();
- cross_navigation_pending_ = false;
+ if (was_caused_by_user_gesture) {
+ // A navigation in the original page has taken place. Cancel the pending
+ // one. Only do it for user gesture originated navigations to prevent
+ // page doing any shenanigans to prevent user from navigating.
+ // See https://code.google.com/p/chromium/issues/detail?id=75195
+ CancelPending();
+ cross_navigation_pending_ = false;
+ }
} else {
// No one else should be sending us DidNavigate in this state.
DCHECK(false);

Powered by Google App Engine
This is Rietveld 408576698