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 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 m_frame.loader().client().dispatchDecidePolicyForNavigationAction(action, re
quest, didReceiveRedirectResponse, formState, policyDecisionMode, [this, functio
n = WTFMove(function), request = ResourceRequest(request), formState = makeRefPt
r(formState), suggestedFilename = WTFMove(suggestedFilename), blobURLLifetimeExt
ension = WTFMove(blobURLLifetimeExtension)](PolicyAction policyAction) mutable { | 171 m_frame.loader().client().dispatchDecidePolicyForNavigationAction(action, re
quest, didReceiveRedirectResponse, formState, policyDecisionMode, [this, functio
n = WTFMove(function), request = ResourceRequest(request), formState = makeRefPt
r(formState), suggestedFilename = WTFMove(suggestedFilename), blobURLLifetimeExt
ension = WTFMove(blobURLLifetimeExtension)](PolicyAction policyAction) mutable { |
172 m_delegateIsDecidingNavigationPolicy = false; | 172 m_delegateIsDecidingNavigationPolicy = false; |
173 | 173 |
174 switch (policyAction) { | 174 switch (policyAction) { |
175 case PolicyAction::Download: | 175 case PolicyAction::Download: |
176 m_frame.loader().setOriginalURLForDownloadRequest(request); | 176 m_frame.loader().setOriginalURLForDownloadRequest(request); |
177 m_frame.loader().client().startDownload(request, suggestedFilename); | 177 m_frame.loader().client().startDownload(request, suggestedFilename); |
178 FALLTHROUGH; | 178 FALLTHROUGH; |
179 case PolicyAction::Ignore: | 179 case PolicyAction::Ignore: |
180 return function({ }, nullptr, ShouldContinue::No); | 180 return function({ }, nullptr, ShouldContinue::No); |
| 181 case PolicyAction::IgnoreAndLockBackForwardList: |
| 182 return function({ }, nullptr, ShouldContinue::NoAndLockBackForwardLi
st); |
181 case PolicyAction::Suspend: | 183 case PolicyAction::Suspend: |
182 return function({ }, nullptr, ShouldContinue::ForSuspension); | 184 return function({ }, nullptr, ShouldContinue::ForSuspension); |
183 case PolicyAction::Use: | 185 case PolicyAction::Use: |
184 if (!m_frame.loader().client().canHandleRequest(request)) { | 186 if (!m_frame.loader().client().canHandleRequest(request)) { |
185 handleUnimplementablePolicy(m_frame.loader().client().cannotShow
URLError(request)); | 187 handleUnimplementablePolicy(m_frame.loader().client().cannotShow
URLError(request)); |
186 return function({ }, nullptr, ShouldContinue::No); | 188 return function({ }, nullptr, ShouldContinue::No); |
187 } | 189 } |
188 return function(WTFMove(request), formState.get(), ShouldContinue::Y
es); | 190 return function(WTFMove(request), formState.get(), ShouldContinue::Y
es); |
189 } | 191 } |
190 ASSERT_NOT_REACHED(); | 192 ASSERT_NOT_REACHED(); |
(...skipping 11 matching lines...) Expand all Loading... |
202 auto blobURLLifetimeExtension = extendBlobURLLifetimeIfNecessary(request); | 204 auto blobURLLifetimeExtension = extendBlobURLLifetimeIfNecessary(request); |
203 | 205 |
204 m_frame.loader().client().dispatchDecidePolicyForNewWindowAction(navigationA
ction, request, formState, frameName, [frame = makeRef(m_frame), request, formSt
ate = makeRefPtr(formState), frameName, navigationAction, function = WTFMove(fun
ction), blobURLLifetimeExtension = WTFMove(blobURLLifetimeExtension)](PolicyActi
on policyAction) mutable { | 206 m_frame.loader().client().dispatchDecidePolicyForNewWindowAction(navigationA
ction, request, formState, frameName, [frame = makeRef(m_frame), request, formSt
ate = makeRefPtr(formState), frameName, navigationAction, function = WTFMove(fun
ction), blobURLLifetimeExtension = WTFMove(blobURLLifetimeExtension)](PolicyActi
on policyAction) mutable { |
205 switch (policyAction) { | 207 switch (policyAction) { |
206 case PolicyAction::Download: | 208 case PolicyAction::Download: |
207 frame->loader().client().startDownload(request); | 209 frame->loader().client().startDownload(request); |
208 FALLTHROUGH; | 210 FALLTHROUGH; |
209 case PolicyAction::Ignore: | 211 case PolicyAction::Ignore: |
210 function({ }, nullptr, { }, { }, ShouldContinue::No); | 212 function({ }, nullptr, { }, { }, ShouldContinue::No); |
211 return; | 213 return; |
| 214 case PolicyAction::IgnoreAndLockBackForwardList: |
| 215 ASSERT_NOT_REACHED(); |
| 216 return; |
212 case PolicyAction::Suspend: | 217 case PolicyAction::Suspend: |
213 // It is invalid to get a "Suspend" policy for new windows, as the o
ld document is not going away. | 218 // It is invalid to get a "Suspend" policy for new windows, as the o
ld document is not going away. |
214 RELEASE_ASSERT_NOT_REACHED(); | 219 RELEASE_ASSERT_NOT_REACHED(); |
215 case PolicyAction::Use: | 220 case PolicyAction::Use: |
216 function(request, formState.get(), frameName, navigationAction, Shou
ldContinue::Yes); | 221 function(request, formState.get(), frameName, navigationAction, Shou
ldContinue::Yes); |
217 return; | 222 return; |
218 } | 223 } |
219 ASSERT_NOT_REACHED(); | 224 ASSERT_NOT_REACHED(); |
220 }); | 225 }); |
221 } | 226 } |
222 | 227 |
223 void PolicyChecker::stopCheck() | 228 void PolicyChecker::stopCheck() |
224 { | 229 { |
225 m_frame.loader().client().cancelPolicyCheck(); | 230 m_frame.loader().client().cancelPolicyCheck(); |
226 } | 231 } |
227 | 232 |
228 void PolicyChecker::cannotShowMIMEType(const ResourceResponse& response) | 233 void PolicyChecker::cannotShowMIMEType(const ResourceResponse& response) |
229 { | 234 { |
230 handleUnimplementablePolicy(m_frame.loader().client().cannotShowMIMETypeErro
r(response)); | 235 handleUnimplementablePolicy(m_frame.loader().client().cannotShowMIMETypeErro
r(response)); |
231 } | 236 } |
232 | 237 |
233 void PolicyChecker::handleUnimplementablePolicy(const ResourceError& error) | 238 void PolicyChecker::handleUnimplementablePolicy(const ResourceError& error) |
234 { | 239 { |
235 m_delegateIsHandlingUnimplementablePolicy = true; | 240 m_delegateIsHandlingUnimplementablePolicy = true; |
236 m_frame.loader().client().dispatchUnableToImplementPolicy(error); | 241 m_frame.loader().client().dispatchUnableToImplementPolicy(error); |
237 m_delegateIsHandlingUnimplementablePolicy = false; | 242 m_delegateIsHandlingUnimplementablePolicy = false; |
238 } | 243 } |
239 | 244 |
240 } // namespace WebCore | 245 } // namespace WebCore |
LEFT | RIGHT |