Chromium Code Reviews| Index: third_party/WebKit/Source/core/loader/FrameLoader.cpp |
| diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
| index e664eb27cae54417d51390f29bb50218095ea927..9bf2eef1d2b206a28637dc60907f120db718bf87 100644 |
| --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
| +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
| @@ -1355,7 +1355,13 @@ void FrameLoader::commitProvisionalLoad() { |
| } |
| client()->transitionToCommittedForNewPage(); |
| - m_frame->navigationScheduler().cancel(); |
| + |
| + // PlzNavigate: We need to ensure that script initiated navigations are |
| + // honored. Exceptions being navigations initiated by the user. |
| + if (!m_isNavigationHandledByClient || |
| + UserGestureIndicator::processingUserGesture()) { |
|
Nate Chapin
2017/01/19 21:02:59
Is this user gesture check necessary to get the te
ananta
2017/01/19 21:38:08
The user gesture flag is passed via the FrameHostM
Nate Chapin
2017/01/19 23:33:50
Right, I got that. I just don't immediately see wh
ananta
2017/01/20 00:00:33
Based on our discussion, removing this check
|
| + m_frame->navigationScheduler().cancel(); |
| + } |
| m_frame->editor().clearLastEditCommand(); |
| // If we are still in the process of initializing an empty document then its |
| @@ -1684,6 +1690,9 @@ void FrameLoader::startLoad(FrameLoadRequest& frameLoadRequest, |
| // request. |
| recordLatestRequiredCSP(); |
| modifyRequestForCSP(resourceRequest, nullptr); |
| + |
| + bool navigationHandledByClient = m_isNavigationHandledByClient; |
|
Nate Chapin
2017/01/19 21:02:59
This should be probably have a "was" in the name,
ananta
2017/01/19 21:38:08
Done.
|
| + |
| if (!shouldContinueForNavigationPolicy( |
| resourceRequest, frameLoadRequest.substituteData(), nullptr, |
| frameLoadRequest.shouldCheckMainWorldContentSecurityPolicy(), |
| @@ -1711,8 +1720,14 @@ void FrameLoader::startLoad(FrameLoadRequest& frameLoadRequest, |
| m_provisionalDocumentLoader->setNavigationType(navigationType); |
| m_provisionalDocumentLoader->setReplacesCurrentHistoryItem( |
| type == FrameLoadTypeReplaceCurrentItem); |
| - m_frame->navigationScheduler().cancel(); |
| - m_checkTimer.stop(); |
| + |
| + // PlzNavigate: We need to ensure that script initiated navigations are |
| + // honored. Exceptions being navigations initiated by the user. |
| + if (!navigationHandledByClient || |
| + UserGestureIndicator::processingUserGesture()) { |
| + m_frame->navigationScheduler().cancel(); |
| + m_checkTimer.stop(); |
| + } |
| m_loadType = type; |