| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv
ed. |
| 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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 #include "core/loader/DocumentLoader.h" | 65 #include "core/loader/DocumentLoader.h" |
| 66 #include "core/loader/FormState.h" | 66 #include "core/loader/FormState.h" |
| 67 #include "core/loader/FormSubmission.h" | 67 #include "core/loader/FormSubmission.h" |
| 68 #include "core/loader/FrameLoadRequest.h" | 68 #include "core/loader/FrameLoadRequest.h" |
| 69 #include "core/loader/FrameLoaderClient.h" | 69 #include "core/loader/FrameLoaderClient.h" |
| 70 #include "core/loader/FrameNetworkingContext.h" | 70 #include "core/loader/FrameNetworkingContext.h" |
| 71 #include "core/loader/ProgressTracker.h" | 71 #include "core/loader/ProgressTracker.h" |
| 72 #include "core/loader/TextResourceDecoder.h" | 72 #include "core/loader/TextResourceDecoder.h" |
| 73 #include "core/loader/UniqueIdentifier.h" | 73 #include "core/loader/UniqueIdentifier.h" |
| 74 #include "core/loader/appcache/ApplicationCacheHost.h" | 74 #include "core/loader/appcache/ApplicationCacheHost.h" |
| 75 #include "core/loader/archive/MHTMLArchive.h" | |
| 76 #include "core/loader/cache/CachedResourceLoader.h" | 75 #include "core/loader/cache/CachedResourceLoader.h" |
| 77 #include "core/loader/cache/MemoryCache.h" | 76 #include "core/loader/cache/MemoryCache.h" |
| 78 #include "core/page/Chrome.h" | 77 #include "core/page/Chrome.h" |
| 79 #include "core/page/ChromeClient.h" | 78 #include "core/page/ChromeClient.h" |
| 80 #include "core/page/Console.h" | 79 #include "core/page/Console.h" |
| 81 #include "core/page/ContentSecurityPolicy.h" | 80 #include "core/page/ContentSecurityPolicy.h" |
| 82 #include "core/page/DOMWindow.h" | 81 #include "core/page/DOMWindow.h" |
| 83 #include "core/page/EditorClient.h" | 82 #include "core/page/EditorClient.h" |
| 84 #include "core/page/EventHandler.h" | 83 #include "core/page/EventHandler.h" |
| 85 #include "core/page/Frame.h" | 84 #include "core/page/Frame.h" |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 | 796 |
| 798 m_didCallImplicitClose = true; | 797 m_didCallImplicitClose = true; |
| 799 m_wasUnloadEventEmitted = false; | 798 m_wasUnloadEventEmitted = false; |
| 800 m_frame->document()->implicitClose(); | 799 m_frame->document()->implicitClose(); |
| 801 } | 800 } |
| 802 | 801 |
| 803 void FrameLoader::loadURLIntoChildFrame(const KURL& url, const String& referer,
Frame* childFrame) | 802 void FrameLoader::loadURLIntoChildFrame(const KURL& url, const String& referer,
Frame* childFrame) |
| 804 { | 803 { |
| 805 ASSERT(childFrame); | 804 ASSERT(childFrame); |
| 806 | 805 |
| 807 RefPtr<MHTMLArchive> subframeArchive = activeDocumentLoader()->popArchiveFor
Subframe(childFrame->tree()->uniqueName(), url); | |
| 808 if (subframeArchive) { | |
| 809 childFrame->loader()->loadArchive(subframeArchive.release()); | |
| 810 return; | |
| 811 } | |
| 812 | |
| 813 HistoryItem* parentItem = history()->currentItem(); | 806 HistoryItem* parentItem = history()->currentItem(); |
| 814 // If we're moving in the back/forward list, we might want to replace the co
ntent | 807 // If we're moving in the back/forward list, we might want to replace the co
ntent |
| 815 // of this child frame with whatever was there at that point. | 808 // of this child frame with whatever was there at that point. |
| 816 if (parentItem && parentItem->children().size() && isBackForwardLoadType(loa
dType()) | 809 if (parentItem && parentItem->children().size() && isBackForwardLoadType(loa
dType()) |
| 817 && !m_frame->document()->loadEventFinished()) { | 810 && !m_frame->document()->loadEventFinished()) { |
| 818 HistoryItem* childItem = parentItem->childItemWithTarget(childFrame->tre
e()->uniqueName()); | 811 HistoryItem* childItem = parentItem->childItemWithTarget(childFrame->tre
e()->uniqueName()); |
| 819 if (childItem) { | 812 if (childItem) { |
| 820 childFrame->loader()->loadDifferentDocumentItem(childItem, loadType(
), MayAttemptCacheOnlyLoadForFormSubmissionItem); | 813 childFrame->loader()->loadDifferentDocumentItem(childItem, loadType(
), MayAttemptCacheOnlyLoadForFormSubmissionItem); |
| 821 return; | 814 return; |
| 822 } | 815 } |
| 823 } | 816 } |
| 824 | 817 |
| 825 childFrame->loader()->loadURL(url, referer, "_self", false, FrameLoadTypeRed
irectWithLockedBackForwardList, 0, 0); | 818 childFrame->loader()->loadURL(url, referer, "_self", false, FrameLoadTypeRed
irectWithLockedBackForwardList, 0, 0); |
| 826 } | 819 } |
| 827 | 820 |
| 828 void FrameLoader::loadArchive(PassRefPtr<MHTMLArchive> archive) | |
| 829 { | |
| 830 ArchiveResource* mainResource = archive->mainResource(); | |
| 831 ASSERT(mainResource); | |
| 832 if (!mainResource) | |
| 833 return; | |
| 834 | |
| 835 SubstituteData substituteData(mainResource->data(), mainResource->mimeType()
, mainResource->textEncoding(), KURL()); | |
| 836 | |
| 837 ResourceRequest request(mainResource->url()); | |
| 838 | |
| 839 RefPtr<DocumentLoader> documentLoader = m_client->createDocumentLoader(reque
st, substituteData); | |
| 840 documentLoader->setArchive(archive.get()); | |
| 841 load(documentLoader.get()); | |
| 842 } | |
| 843 | |
| 844 ObjectContentType FrameLoader::defaultObjectContentType(const KURL& url, const S
tring& mimeTypeIn, bool shouldPreferPlugInsForImages) | 821 ObjectContentType FrameLoader::defaultObjectContentType(const KURL& url, const S
tring& mimeTypeIn, bool shouldPreferPlugInsForImages) |
| 845 { | 822 { |
| 846 String mimeType = mimeTypeIn; | 823 String mimeType = mimeTypeIn; |
| 847 | 824 |
| 848 if (mimeType.isEmpty()) | 825 if (mimeType.isEmpty()) |
| 849 mimeType = mimeTypeFromURL(url); | 826 mimeType = mimeTypeFromURL(url); |
| 850 | 827 |
| 851 if (mimeType.isEmpty()) | 828 if (mimeType.isEmpty()) |
| 852 return ObjectContentFrame; // Go ahead and hope that we can display the
content. | 829 return ObjectContentFrame; // Go ahead and hope that we can display the
content. |
| 853 | 830 |
| (...skipping 2094 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2948 FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect); | 2925 FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect); |
| 2949 | 2926 |
| 2950 page->chrome()->setWindowRect(newWindowRect); | 2927 page->chrome()->setWindowRect(newWindowRect); |
| 2951 page->chrome()->show(); | 2928 page->chrome()->show(); |
| 2952 | 2929 |
| 2953 created = true; | 2930 created = true; |
| 2954 return frame; | 2931 return frame; |
| 2955 } | 2932 } |
| 2956 | 2933 |
| 2957 } // namespace WebCore | 2934 } // namespace WebCore |
| OLD | NEW |