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

Unified Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 1446253002: PlzNavigate: inform the WebFrameClient that a form will be submitted (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 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 | « third_party/WebKit/Source/core/loader/FrameLoader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6b0a1d00bc0cf7e4c20a489f25496a939d4ab7c7..77d724dbd911fb4886c590150a18819df6d4d1b1 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -1333,7 +1333,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())
@@ -1363,6 +1363,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);
+
return false;
}
if (!LocalDOMWindow::allowPopUp(*m_frame) && !UserGestureIndicator::processingUserGesture())
@@ -1383,8 +1389,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;
« no previous file with comments | « third_party/WebKit/Source/core/loader/FrameLoader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698