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

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

Issue 10941050: Second try of 157576 https://chromiumcodereview.appspot.com/10780013/ (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 3 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
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/navigation_controller_impl.cc
===================================================================
--- content/browser/web_contents/navigation_controller_impl.cc (revision 157505)
+++ content/browser/web_contents/navigation_controller_impl.cc (working copy)
@@ -923,11 +923,21 @@
update_virtual_url = new_entry->update_virtual_url_with_url();
} else {
new_entry = new NavigationEntryImpl;
+
+ // Find out whether the new entry needs to update its virtual URL on URL
+ // change and set up the entry accordingly. This is needed to correctly
+ // update the virtual URL when replaceState is called after a pushState.
+ GURL url = params.url;
+ bool needs_update = false;
+ BrowserURLHandlerImpl::GetInstance()->RewriteURLIfNecessary(
+ &url, browser_context_, &needs_update);
+ new_entry->set_update_virtual_url_with_url(needs_update);
+
// When navigating to a new page, give the browser URL handler a chance to
// update the virtual URL based on the new URL. For example, this is needed
// to show chrome://bookmarks/#1 when the bookmarks webui extension changes
// the URL.
- update_virtual_url = true;
+ update_virtual_url = needs_update;
}
new_entry->SetURL(params.url);
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698