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

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 on 1608283002 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 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;
« 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