Chromium Code Reviews| Index: content/browser/web_contents/navigation_controller_impl.cc |
| =================================================================== |
| --- content/browser/web_contents/navigation_controller_impl.cc (revision 156197) |
| +++ 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. |
|
Charlie Reis
2012/09/13 22:10:09
We were always doing this before, by using true on
Cem Kocagil
2012/09/13 22:40:03
Actually the only thing that is of importance to m
Charlie Reis
2012/09/13 22:58:23
Oh, I didn't realize that was the important part.
|
| + GURL temp = params.url; |
|
Charlie Reis
2012/09/13 22:10:09
nit: Please use a better variable name than temp.
|
| + bool reverse_on_redirect = false; |
| + BrowserURLHandlerImpl::GetInstance()->RewriteURLIfNecessary( |
| + &temp, browser_context_, &reverse_on_redirect); |
| + new_entry->set_update_virtual_url_with_url(reverse_on_redirect); |
| + |
| // 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 = reverse_on_redirect; |
| } |
| new_entry->SetURL(params.url); |