| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * Copyright (C) 2011 Google Inc. All rights reserved. | 3 * Copyright (C) 2011 Google Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
| 6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
| 7 * are met: | 7 * are met: |
| 8 * | 8 * |
| 9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
| 10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 m_frame->ownerElement()->dispatchEvent(Event::create(EventTypeNames::loa
d)); | 307 m_frame->ownerElement()->dispatchEvent(Event::create(EventTypeNames::loa
d)); |
| 308 return false; | 308 return false; |
| 309 } | 309 } |
| 310 | 310 |
| 311 NavigationPolicy policy = m_triggeringAction.policy(); | 311 NavigationPolicy policy = m_triggeringAction.policy(); |
| 312 policy = frameLoader()->client()->decidePolicyForNavigation(request, this, p
olicy); | 312 policy = frameLoader()->client()->decidePolicyForNavigation(request, this, p
olicy); |
| 313 if (policy == NavigationPolicyCurrentTab) | 313 if (policy == NavigationPolicyCurrentTab) |
| 314 return true; | 314 return true; |
| 315 if (policy == NavigationPolicyIgnore) | 315 if (policy == NavigationPolicyIgnore) |
| 316 return false; | 316 return false; |
| 317 if (!DOMWindow::allowPopUp(m_frame) && !UserGestureIndicator::processingUser
Gesture()) | 317 if (!DOMWindow::allowPopUp(*m_frame) && !UserGestureIndicator::processingUse
rGesture()) |
| 318 return false; | 318 return false; |
| 319 frameLoader()->client()->loadURLExternally(request, policy); | 319 frameLoader()->client()->loadURLExternally(request, policy); |
| 320 return false; | 320 return false; |
| 321 } | 321 } |
| 322 | 322 |
| 323 void DocumentLoader::redirectReceived(Resource* resource, ResourceRequest& reque
st, const ResourceResponse& redirectResponse) | 323 void DocumentLoader::redirectReceived(Resource* resource, ResourceRequest& reque
st, const ResourceResponse& redirectResponse) |
| 324 { | 324 { |
| 325 ASSERT_UNUSED(resource, resource == m_mainResource); | 325 ASSERT_UNUSED(resource, resource == m_mainResource); |
| 326 willSendRequest(request, redirectResponse); | 326 willSendRequest(request, redirectResponse); |
| 327 } | 327 } |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 802 // "securely transition" the existing DOMWindow to the Document that results
from | 802 // "securely transition" the existing DOMWindow to the Document that results
from |
| 803 // the network load. See also SecurityContext::isSecureTransitionTo. | 803 // the network load. See also SecurityContext::isSecureTransitionTo. |
| 804 bool shouldReuseDefaultView = frame->loader().stateMachine()->isDisplayingIn
itialEmptyDocument() && frame->document()->isSecureTransitionTo(url); | 804 bool shouldReuseDefaultView = frame->loader().stateMachine()->isDisplayingIn
itialEmptyDocument() && frame->document()->isSecureTransitionTo(url); |
| 805 | 805 |
| 806 frame->loader().clear(); | 806 frame->loader().clear(); |
| 807 | 807 |
| 808 if (frame->document()) | 808 if (frame->document()) |
| 809 frame->document()->prepareForDestruction(); | 809 frame->document()->prepareForDestruction(); |
| 810 | 810 |
| 811 if (!shouldReuseDefaultView) | 811 if (!shouldReuseDefaultView) |
| 812 frame->setDOMWindow(DOMWindow::create(frame)); | 812 frame->setDOMWindow(DOMWindow::create(*frame)); |
| 813 | 813 |
| 814 RefPtr<Document> document = frame->domWindow()->installNewDocument(mimeType,
init); | 814 RefPtr<Document> document = frame->domWindow()->installNewDocument(mimeType,
init); |
| 815 if (ownerDocument) { | 815 if (ownerDocument) { |
| 816 document->setCookieURL(ownerDocument->cookieURL()); | 816 document->setCookieURL(ownerDocument->cookieURL()); |
| 817 document->setSecurityOrigin(ownerDocument->securityOrigin()); | 817 document->setSecurityOrigin(ownerDocument->securityOrigin()); |
| 818 } | 818 } |
| 819 | 819 |
| 820 frame->loader().didBeginDocument(dispatch); | 820 frame->loader().didBeginDocument(dispatch); |
| 821 | 821 |
| 822 return DocumentWriter::create(document.get(), mimeType, encoding, userChosen
); | 822 return DocumentWriter::create(document.get(), mimeType, encoding, userChosen
); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 841 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) | 841 void DocumentLoader::replaceDocument(const String& source, Document* ownerDocume
nt) |
| 842 { | 842 { |
| 843 m_frame->loader().stopAllLoaders(); | 843 m_frame->loader().stopAllLoaders(); |
| 844 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer
->encodingWasChosenByUser() : false, true); | 844 m_writer = createWriterFor(m_frame, ownerDocument, m_frame->document()->url(
), mimeType(), m_writer ? m_writer->encoding() : emptyAtom, m_writer ? m_writer
->encodingWasChosenByUser() : false, true); |
| 845 if (!source.isNull()) | 845 if (!source.isNull()) |
| 846 m_writer->appendReplacingData(source); | 846 m_writer->appendReplacingData(source); |
| 847 endWriting(m_writer.get()); | 847 endWriting(m_writer.get()); |
| 848 } | 848 } |
| 849 | 849 |
| 850 } // namespace WebCore | 850 } // namespace WebCore |
| OLD | NEW |