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

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

Issue 2580753002: Fix NavigationControllerBrowserTest. EnsureSamePageNavigationUpdatesFrameNavigationEntry browser nav (Closed)
Patch Set: Fix redness Created 4 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
« no previous file with comments | « no previous file | testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigation_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 2d90ebb2f9db861d3fd425e46ce60d45039c25a8..218446898993733af3d660b34c0f4c58f3654d4f 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1782,6 +1782,25 @@ void NavigationControllerImpl::NavigateToPendingEntry(ReloadType reload_type) {
CancelForNavigation();
}
+ // Convert Enter-in-omnibox to a reload. This is what Blink does in
+ // FrameLoader, but we want to handle it here so that if the navigation is
+ // redirected or handled purely on the browser side in PlzNavigate we have the
+ // same behaviour as Blink would. Note that we don't want to convert to a
+ // reload for history navigations, so this must be above the retrieval of the
+ // pending_entry_ below when pending_entry_index_ is used.
+ if (reload_type == ReloadType::NONE && GetLastCommittedEntry() &&
+ pending_entry_ && pending_entry_->frame_tree_node_id() == -1 &&
+ pending_entry_->GetURL() == GetLastCommittedEntry()->GetURL() &&
+ !pending_entry_->GetHasPostData() &&
+ // Android uses data urls in WebViews. Skipping them here to see if
+ // it fixes http://crbug.com/664319. Should we check for OS_ANDROID here?
+ !pending_entry_->GetURL().SchemeIs(url::kDataScheme) &&
Charlie Reis 2016/12/15 22:28:09 I like the idea of keeping essentially the same fi
ananta 2016/12/16 00:42:28 Thanks. I checked with boliu. He mentioned that th
+ // This check is required for Android WebView loadDataWithBaseURL.
+ GetLastCommittedEntry()->GetVirtualURL() ==
+ pending_entry_->GetVirtualURL()) {
+ reload_type = ReloadType::NORMAL;
+ }
+
// For session history navigations only the pending_entry_index_ is set.
if (!pending_entry_) {
CHECK_NE(pending_entry_index_, -1);
« no previous file with comments | « no previous file | testing/buildbot/filters/browser-side-navigation.linux.content_browsertests.filter » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698