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 038cf60a8afc2b21412fab348d49efb7f0661d53..a2e5f377d10796165ae5efb11e578fe29b979f7a 100644 |
| --- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
| +++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp |
| @@ -1322,7 +1322,7 @@ bool FrameLoader::shouldClose(bool isReload) |
| bool FrameLoader::shouldContinueForNavigationPolicy(const ResourceRequest& request, const SubstituteData& substituteData, |
| DocumentLoader* loader, ContentSecurityPolicyDisposition shouldCheckMainWorldContentSecurityPolicy, |
| - NavigationType type, NavigationPolicy policy, bool replacesCurrentHistoryItem, bool isClientRedirect) |
| + NavigationType type, NavigationPolicy policy, bool replacesCurrentHistoryItem, bool isClientRedirect, HTMLFormElement* form) |
| { |
| // Don't ask if we are loading an empty URL. |
| if (request.url().isEmpty() || substituteData.isValid()) |
| @@ -1352,6 +1352,12 @@ bool FrameLoader::shouldContinueForNavigationPolicy(const ResourceRequest& reque |
| if (policy == NavigationPolicyHandledByClient) { |
| // Mark the frame as loading since the embedder is handling the navigation. |
| m_progressTracker->progressStarted(); |
| + |
| + // If this is a form submit, dispatch that a form is being submitted |
| + // since the embedder is handling the navigation. |
| + if (form) |
| + client()->dispatchWillSubmitForm(form); |
|
dcheng
2016/02/24 21:24:55
Just curious: shouldn't the embedder "know" it is
clamy
2016/02/25 14:34:07
I'm not sure how exactly the embedder know the nav
dcheng
2016/02/25 21:56:17
Makes sense, thanks.
|
| + |
| return false; |
| } |
| if (!LocalDOMWindow::allowPopUp(*m_frame) && !UserGestureIndicator::processingUserGesture()) |
| @@ -1372,8 +1378,13 @@ void FrameLoader::startLoad(FrameLoadRequest& frameLoadRequest, FrameLoadType ty |
| frameLoadRequest.resourceRequest().setRequestContext(determineRequestContextFromNavigationType(navigationType)); |
| frameLoadRequest.resourceRequest().setFrameType(m_frame->isMainFrame() ? WebURLRequest::FrameTypeTopLevel : WebURLRequest::FrameTypeNested); |
| ResourceRequest& request = frameLoadRequest.resourceRequest(); |
| - if (!shouldContinueForNavigationPolicy(request, frameLoadRequest.substituteData(), nullptr, frameLoadRequest.shouldCheckMainWorldContentSecurityPolicy(), navigationType, navigationPolicy, type == FrameLoadTypeReplaceCurrentItem, frameLoadRequest.clientRedirect() == ClientRedirect)) |
| + if (!shouldContinueForNavigationPolicy(request, frameLoadRequest.substituteData(), nullptr, |
| + frameLoadRequest.shouldCheckMainWorldContentSecurityPolicy(), navigationType, |
| + navigationPolicy, type == FrameLoadTypeReplaceCurrentItem, |
| + frameLoadRequest.clientRedirect() == ClientRedirect, frameLoadRequest.form())) { |
| return; |
| + } |
| + |
| if (!shouldClose(navigationType == NavigationTypeReload)) |
| return; |