Commit ff0e61e1 authored by Justin Cohen's avatar Justin Cohen Committed by Commit Bot

[SlimNav] Followup to 'use targetURL when reloading restore session error pages.'

Tighten up some of the logic for when to apply the targetURL fix.  Only target
real relow pages, not renderer initated navigations (such as restoration) and
back forward navigations.

Bug: 1002656
Change-Id: I837257128784167d2a1cdd6e305952aaea3df7bf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1797703
Commit-Queue: Justin Cohen <justincohen@chromium.org>
Commit-Queue: Ali Juma <ajuma@chromium.org>
Auto-Submit: Justin Cohen <justincohen@chromium.org>
Reviewed-by: default avatarAli Juma <ajuma@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695701}
parent 8d3cb5b1
...@@ -200,8 +200,9 @@ void WKBasedNavigationManagerImpl::AddPendingItem( ...@@ -200,8 +200,9 @@ void WKBasedNavigationManagerImpl::AddPendingItem(
// When reloading an target url redirect page, re-use the target url as the // When reloading an target url redirect page, re-use the target url as the
// current item url. // current item url.
GURL target_url; GURL target_url;
if (ui::PageTransitionCoreTypeIs(navigation_type, if (navigation_type & ui::PAGE_TRANSITION_RELOAD &&
ui::PAGE_TRANSITION_RELOAD) && !(navigation_type & ui::PAGE_TRANSITION_FORWARD_BACK) &&
initiation_type == NavigationInitiationType::BROWSER_INITIATED &&
web::wk_navigation_util::IsRestoreSessionUrl(current_item_url) && web::wk_navigation_util::IsRestoreSessionUrl(current_item_url) &&
web::wk_navigation_util::ExtractTargetURL(current_item_url, web::wk_navigation_util::ExtractTargetURL(current_item_url,
&target_url)) { &target_url)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment