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

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: 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..5dd22a39b4a2c6d4cdacb6dbdf10c492c8a8ad35 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_within_same_page) {
if (!cross_navigation_pending_) {
DCHECK(!pending_render_frame_host_);
@@ -435,14 +436,15 @@ void RenderFrameHostManager::DidNavigateFrame(
// The pending cross-site navigation completed, so show the renderer.
CommitPending();
cross_navigation_pending_ = false;
- } else if (render_frame_host == render_frame_host_) {
+ } else if (render_frame_host == render_frame_host_ &&
+ !was_within_same_page) {
Charlie Reis 2014/12/02 18:03:33 This wouldn't be the right place to do this. It o
// A navigation in the original page has taken place. Cancel the pending
// one.
CancelPending();
cross_navigation_pending_ = false;
} else {
// No one else should be sending us DidNavigate in this state.
- DCHECK(false);
+ DCHECK(was_within_same_page);
}
}

Powered by Google App Engine
This is Rietveld 408576698