LEFT | RIGHT |
(no file at all) | |
1 /* | 1 /* |
2 * Copyright (C) 2006-2016 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006-2016 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 3 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 4 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> | 5 * Copyright (C) 2008 Alp Toker <alp@atoker.com> |
6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. | 6 * Copyright (C) Research In Motion Limited 2009. All rights reserved. |
7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> | 7 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> |
8 * Copyright (C) 2011 Google Inc. All rights reserved. | 8 * Copyright (C) 2011 Google Inc. All rights reserved. |
9 * | 9 * |
10 * Redistribution and use in source and binary forms, with or without | 10 * Redistribution and use in source and binary forms, with or without |
(...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1420 } | 1420 } |
1421 | 1421 |
1422 if (!request.hasSubstituteData()) | 1422 if (!request.hasSubstituteData()) |
1423 request.setSubstituteData(defaultSubstituteDataForURL(request.resourceRe
quest().url())); | 1423 request.setSubstituteData(defaultSubstituteDataForURL(request.resourceRe
quest().url())); |
1424 | 1424 |
1425 Ref<DocumentLoader> loader = m_client.createDocumentLoader(request.resourceR
equest(), request.substituteData()); | 1425 Ref<DocumentLoader> loader = m_client.createDocumentLoader(request.resourceR
equest(), request.substituteData()); |
1426 addSameSiteInfoToRequestIfNeeded(loader->request()); | 1426 addSameSiteInfoToRequestIfNeeded(loader->request()); |
1427 applyShouldOpenExternalURLsPolicyToNewDocumentLoader(m_frame, loader, reques
t); | 1427 applyShouldOpenExternalURLsPolicyToNewDocumentLoader(m_frame, loader, reques
t); |
1428 | 1428 |
1429 SetForScope<bool> currentLoadShouldCheckNavigationPolicyGuard(m_currentLoadS
houldCheckNavigationPolicy, request.shouldCheckNavigationPolicy()); | 1429 SetForScope<bool> currentLoadShouldCheckNavigationPolicyGuard(m_currentLoadS
houldCheckNavigationPolicy, request.shouldCheckNavigationPolicy()); |
| 1430 if (request.lockBackForwardList() == LockBackForwardList::Yes) |
| 1431 m_loadType = FrameLoadType::RedirectWithLockedBackForwardList; |
1430 load(loader.ptr()); | 1432 load(loader.ptr()); |
1431 } | 1433 } |
1432 | 1434 |
1433 void FrameLoader::loadWithNavigationAction(const ResourceRequest& request, const
NavigationAction& action, LockHistory lockHistory, FrameLoadType type, FormStat
e* formState, AllowNavigationToInvalidURL allowNavigationToInvalidURL, Completio
nHandler<void()>&& completionHandler) | 1435 void FrameLoader::loadWithNavigationAction(const ResourceRequest& request, const
NavigationAction& action, LockHistory lockHistory, FrameLoadType type, FormStat
e* formState, AllowNavigationToInvalidURL allowNavigationToInvalidURL, Completio
nHandler<void()>&& completionHandler) |
1434 { | 1436 { |
1435 Ref<DocumentLoader> loader = m_client.createDocumentLoader(request, defaultS
ubstituteDataForURL(request.url())); | 1437 Ref<DocumentLoader> loader = m_client.createDocumentLoader(request, defaultS
ubstituteDataForURL(request.url())); |
1436 applyShouldOpenExternalURLsPolicyToNewDocumentLoader(m_frame, loader, action
.initiatedByMainFrame(), action.shouldOpenExternalURLsPolicy()); | 1438 applyShouldOpenExternalURLsPolicyToNewDocumentLoader(m_frame, loader, action
.initiatedByMainFrame(), action.shouldOpenExternalURLsPolicy()); |
1437 | 1439 |
1438 if (lockHistory == LockHistory::Yes && m_documentLoader) | 1440 if (lockHistory == LockHistory::Yes && m_documentLoader) |
1439 loader->setClientRedirectSourceForHistory(m_documentLoader->didCreateGlo
balHistoryEntry() ? m_documentLoader->urlForHistory().string() : m_documentLoade
r->clientRedirectSourceForHistory()); | 1441 loader->setClientRedirectSourceForHistory(m_documentLoader->didCreateGlo
balHistoryEntry() ? m_documentLoader->urlForHistory().string() : m_documentLoade
r->clientRedirectSourceForHistory()); |
(...skipping 1777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3217 void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest& reque
st, FormState* formState, ShouldContinue shouldContinue, AllowNavigationToInvali
dURL allowNavigationToInvalidURL) | 3219 void FrameLoader::continueLoadAfterNavigationPolicy(const ResourceRequest& reque
st, FormState* formState, ShouldContinue shouldContinue, AllowNavigationToInvali
dURL allowNavigationToInvalidURL) |
3218 { | 3220 { |
3219 // If we loaded an alternate page to replace an unreachableURL, we'll get in
here with a | 3221 // If we loaded an alternate page to replace an unreachableURL, we'll get in
here with a |
3220 // nil policyDataSource because loading the alternate page will have passed | 3222 // nil policyDataSource because loading the alternate page will have passed |
3221 // through this method already, nested; otherwise, policyDataSource should s
till be set. | 3223 // through this method already, nested; otherwise, policyDataSource should s
till be set. |
3222 ASSERT(m_policyDocumentLoader || !m_provisionalDocumentLoader->unreachableUR
L().isEmpty()); | 3224 ASSERT(m_policyDocumentLoader || !m_provisionalDocumentLoader->unreachableUR
L().isEmpty()); |
3223 | 3225 |
3224 bool isTargetItem = history().provisionalItem() ? history().provisionalItem(
)->isTargetItem() : false; | 3226 bool isTargetItem = history().provisionalItem() ? history().provisionalItem(
)->isTargetItem() : false; |
3225 | 3227 |
3226 bool urlIsDisallowed = allowNavigationToInvalidURL == AllowNavigationToInval
idURL::No && !request.url().isValid(); | 3228 bool urlIsDisallowed = allowNavigationToInvalidURL == AllowNavigationToInval
idURL::No && !request.url().isValid(); |
3227 bool canContinue = shouldContinue != ShouldContinue::No && shouldClose() &&
!urlIsDisallowed; | 3229 bool canContinue = (shouldContinue != ShouldContinue::No && shouldContinue !
= ShouldContinue::NoAndLockBackForwardList) && shouldClose() && !urlIsDisallowed
; |
3228 | 3230 |
3229 if (!canContinue) { | 3231 if (!canContinue) { |
3230 // If we were waiting for a quick redirect, but the policy delegate deci
ded to ignore it, then we· | 3232 // If we were waiting for a quick redirect, but the policy delegate deci
ded to ignore it, then we· |
3231 // need to report that the client redirect was cancelled. | 3233 // need to report that the client redirect was cancelled. |
3232 // FIXME: The client should be told about ignored non-quick redirects, t
oo. | 3234 // FIXME: The client should be told about ignored non-quick redirects, t
oo. |
3233 if (m_quickRedirectComing) | 3235 if (m_quickRedirectComing) |
3234 clientRedirectCancelledOrFinished(false); | 3236 clientRedirectCancelledOrFinished(false); |
3235 | 3237 |
3236 setPolicyDocumentLoader(nullptr); | 3238 setPolicyDocumentLoader(nullptr); |
3237 checkCompleted(); | 3239 checkCompleted(); |
3238 checkLoadComplete(); | 3240 checkLoadComplete(); |
3239 | 3241 |
3240 // If the navigation request came from the back/forward menu, and we pun
t on it, we have the· | 3242 // If the navigation request came from the back/forward menu, and we pun
t on it, we have the· |
3241 // problem that we have optimistically moved the b/f cursor already, so
move it back. For sanity, | 3243 // problem that we have optimistically moved the b/f cursor already, so
move it back. For sanity, |
3242 // we only do this when punting a navigation for the target frame or top
-level frame.·· | 3244 // we only do this when punting a navigation for the target frame or top
-level frame.·· |
3243 if ((isTargetItem || m_frame.isMainFrame()) && isBackForwardLoadType(pol
icyChecker().loadType())) { | 3245 if ((isTargetItem || m_frame.isMainFrame()) && isBackForwardLoadType(pol
icyChecker().loadType())) { |
3244 if (Page* page = m_frame.page()) { | 3246 if (shouldContinue == ShouldContinue::NoAndLockBackForwardList) { |
| 3247 m_loadType = policyChecker().loadType(); |
| 3248 m_frame.mainFrame().loader().history().updateForCommit(); |
| 3249 } else if (Page* page = m_frame.page()) { |
3245 if (HistoryItem* resetItem = m_frame.mainFrame().loader().histor
y().currentItem()) { | 3250 if (HistoryItem* resetItem = m_frame.mainFrame().loader().histor
y().currentItem()) { |
3246 page->backForward().setCurrentItem(resetItem); | 3251 page->backForward().setCurrentItem(resetItem); |
3247 m_frame.loader().client().updateGlobalHistoryItemForPage(); | 3252 m_frame.loader().client().updateGlobalHistoryItemForPage(); |
3248 } | 3253 } |
3249 } | 3254 } |
3250 } | 3255 } |
3251 return; | 3256 return; |
3252 } | 3257 } |
3253 | 3258 |
3254 FrameLoadType type = policyChecker().loadType(); | 3259 FrameLoadType type = policyChecker().loadType(); |
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3956 created = true; | 3961 created = true; |
3957 return frame; | 3962 return frame; |
3958 } | 3963 } |
3959 | 3964 |
3960 bool FrameLoader::shouldSuppressTextInputFromEditing() const | 3965 bool FrameLoader::shouldSuppressTextInputFromEditing() const |
3961 { | 3966 { |
3962 return m_frame.settings().shouldSuppressTextInputFromEditingDuringProvisiona
lNavigation() && m_state == FrameStateProvisional; | 3967 return m_frame.settings().shouldSuppressTextInputFromEditingDuringProvisiona
lNavigation() && m_state == FrameStateProvisional; |
3963 } | 3968 } |
3964 | 3969 |
3965 } // namespace WebCore | 3970 } // namespace WebCore |
LEFT | RIGHT |