Chromium Code Reviews| 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 947 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 958 RefPtr<HistoryItem> currentItem = history()->currentItem(); | 958 RefPtr<HistoryItem> currentItem = history()->currentItem(); |
| 959 if (!currentItem) { | 959 if (!currentItem) { |
| 960 insertDummyHistoryItem(); | 960 insertDummyHistoryItem(); |
| 961 | 961 |
| 962 ASSERT(stateMachine()->isDisplayingInitialEmptyDocument()); | 962 ASSERT(stateMachine()->isDisplayingInitialEmptyDocument()); |
| 963 stateMachine()->advanceTo(FrameLoaderStateMachine::DisplayingInitialEmpt yDocumentPostCommit); | 963 stateMachine()->advanceTo(FrameLoaderStateMachine::DisplayingInitialEmpt yDocumentPostCommit); |
| 964 stateMachine()->advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoa d); | 964 stateMachine()->advanceTo(FrameLoaderStateMachine::CommittedFirstRealLoa d); |
| 965 } | 965 } |
| 966 } | 966 } |
| 967 | 967 |
| 968 void FrameLoader::prepareForLoadStart() | |
| 969 { | |
| 970 m_progressTracker->progressStarted(); | |
| 971 m_client->dispatchDidStartProvisionalLoad(); | |
| 972 | |
| 973 // Notify accessibility. | |
| 974 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) { | |
| 975 AXObjectCache::AXLoadingEvent loadingEvent = loadType() == FrameLoadType Reload ? AXObjectCache::AXLoadingReloaded : AXObjectCache::AXLoadingStarted; | |
| 976 cache->frameLoadingEventNotification(m_frame, loadingEvent); | |
| 977 } | |
| 978 } | |
| 979 | |
| 980 void FrameLoader::loadFrameRequest(const FrameLoadRequest& request, bool lockBac kForwardList, | 968 void FrameLoader::loadFrameRequest(const FrameLoadRequest& request, bool lockBac kForwardList, |
| 981 PassRefPtr<Event> event, PassRefPtr<FormState> formState, ShouldSendReferrer shouldSendReferrer) | 969 PassRefPtr<Event> event, PassRefPtr<FormState> formState, ShouldSendReferrer shouldSendReferrer) |
| 982 { | 970 { |
| 983 // Protect frame from getting blown away inside dispatchBeforeLoadEvent in l oadWithDocumentLoader. | 971 // Protect frame from getting blown away inside dispatchBeforeLoadEvent in l oadWithDocumentLoader. |
| 984 RefPtr<Frame> protect(m_frame); | 972 RefPtr<Frame> protect(m_frame); |
| 985 | 973 |
| 986 KURL url = request.resourceRequest().url(); | 974 KURL url = request.resourceRequest().url(); |
| 987 | 975 |
| 988 ASSERT(m_frame->document()); | 976 ASSERT(m_frame->document()); |
| 989 if (!request.requester()->canDisplay(url)) { | 977 if (!request.requester()->canDisplay(url)) { |
| (...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2104 | 2092 |
| 2105 setProvisionalDocumentLoader(m_policyDocumentLoader.get()); | 2093 setProvisionalDocumentLoader(m_policyDocumentLoader.get()); |
| 2106 m_loadType = type; | 2094 m_loadType = type; |
| 2107 setState(FrameStateProvisional); | 2095 setState(FrameStateProvisional); |
| 2108 | 2096 |
| 2109 setPolicyDocumentLoader(0); | 2097 setPolicyDocumentLoader(0); |
| 2110 | 2098 |
| 2111 if (formState) | 2099 if (formState) |
| 2112 m_client->dispatchWillSubmitForm(formState); | 2100 m_client->dispatchWillSubmitForm(formState); |
| 2113 | 2101 |
| 2114 prepareForLoadStart(); | 2102 m_progressTracker->progressStarted(); |
| 2103 m_client->dispatchDidStartProvisionalLoad(); | |
| 2104 ASSERT(m_policyDocumentLoader); | |
| 2115 | 2105 |
| 2116 // The load might be cancelled inside of prepareForLoadStart(), nulling out the m_provisionalDocumentLoader, | 2106 // Notify accessibility. |
|
abarth-chromium
2013/06/27 23:21:25
I would remove this comment :)
| |
| 2117 // so we need to null check it again. | 2107 if (AXObjectCache* cache = m_frame->document()->existingAXObjectCache()) { |
| 2118 if (!m_provisionalDocumentLoader) | 2108 AXObjectCache::AXLoadingEvent loadingEvent = loadType() == FrameLoadType Reload ? AXObjectCache::AXLoadingReloaded : AXObjectCache::AXLoadingStarted; |
| 2119 return; | 2109 cache->frameLoadingEventNotification(m_frame, loadingEvent); |
| 2120 | 2110 } |
| 2121 DocumentLoader* activeDocLoader = activeDocumentLoader(); | |
| 2122 if (activeDocLoader && activeDocLoader->isLoadingMainResource()) | |
| 2123 return; | |
| 2124 | 2111 |
| 2125 m_provisionalDocumentLoader->startLoadingMainResource(); | 2112 m_provisionalDocumentLoader->startLoadingMainResource(); |
| 2126 } | 2113 } |
| 2127 | 2114 |
| 2128 void FrameLoader::checkNewWindowPolicyAndContinue(PassRefPtr<FormState> formStat e, const String& frameName, const NavigationAction& action) | 2115 void FrameLoader::checkNewWindowPolicyAndContinue(PassRefPtr<FormState> formStat e, const String& frameName, const NavigationAction& action) |
| 2129 { | 2116 { |
| 2130 if (m_frame->document() && m_frame->document()->isSandboxed(SandboxPopups)) | 2117 if (m_frame->document() && m_frame->document()->isSandboxed(SandboxPopups)) |
| 2131 return; | 2118 return; |
| 2132 | 2119 |
| 2133 if (!DOMWindow::allowPopUp(m_frame)) | 2120 if (!DOMWindow::allowPopUp(m_frame)) |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2542 FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect); | 2529 FloatRect newWindowRect = DOMWindow::adjustWindowRect(page, windowRect); |
| 2543 | 2530 |
| 2544 page->chrome().setWindowRect(newWindowRect); | 2531 page->chrome().setWindowRect(newWindowRect); |
| 2545 page->chrome().show(); | 2532 page->chrome().show(); |
| 2546 | 2533 |
| 2547 created = true; | 2534 created = true; |
| 2548 return frame; | 2535 return frame; |
| 2549 } | 2536 } |
| 2550 | 2537 |
| 2551 } // namespace WebCore | 2538 } // namespace WebCore |
| OLD | NEW |