diff options
author | Cary Clark <> | 2009-04-14 06:33:00 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-04-14 06:33:00 -0700 |
commit | 563af33bc48281d19dce701398dbb88cb54fd7ec (patch) | |
tree | 395b4502f029dea8b25b342d66dc06b5d8f99985 /WebKit/win/WebCoreSupport | |
parent | 5cfedfef172691d0f4bcf2be5ca3cddd8c9a47f4 (diff) | |
download | external_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.zip external_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.tar.gz external_webkit-563af33bc48281d19dce701398dbb88cb54fd7ec.tar.bz2 |
AI 146110: add missing files to webkit
brings it in sync with webkit svn cl 42046
Automated import of CL 146110
Diffstat (limited to 'WebKit/win/WebCoreSupport')
-rw-r--r-- | WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp | 62 | ||||
-rw-r--r-- | WebKit/win/WebCoreSupport/WebFrameLoaderClient.h | 5 | ||||
-rw-r--r-- | WebKit/win/WebCoreSupport/WebInspectorClient.cpp | 7 | ||||
-rw-r--r-- | WebKit/win/WebCoreSupport/WebInspectorClient.h | 2 |
4 files changed, 57 insertions, 19 deletions
diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp index 1af1673..c307660 100644 --- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp +++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.cpp @@ -41,6 +41,7 @@ #include "WebError.h" #include "WebFrame.h" #include "WebHistory.h" +#include "WebHistoryItem.h" #include "WebMutableURLRequest.h" #include "WebNotificationCenter.h" #include "WebScriptDebugServer.h" @@ -53,9 +54,11 @@ #include <WebCore/FrameLoader.h> #include <WebCore/FrameTree.h> #include <WebCore/FrameView.h> +#include <WebCore/HTMLAppletElement.h> #include <WebCore/HTMLFrameElement.h> #include <WebCore/HTMLFrameOwnerElement.h> #include <WebCore/HTMLNames.h> +#include <WebCore/HTMLPlugInElement.h> #include <WebCore/HistoryItem.h> #include <WebCore/Page.h> #include <WebCore/PluginPackage.h> @@ -91,7 +94,9 @@ bool WebFrameLoaderClient::hasWebView() const void WebFrameLoaderClient::forceLayout() { - core(m_webFrame)->forceLayout(true); + FrameView* view = core(m_webFrame)->view(); + if (view) + view->forceLayout(true); } void WebFrameLoaderClient::assignIdentifierToInitialRequest(unsigned long identifier, DocumentLoader* loader, const ResourceRequest& request) @@ -221,6 +226,25 @@ void WebFrameLoaderClient::dispatchDidFailLoading(DocumentLoader* loader, unsign resourceLoadDelegate->didFailLoadingWithError(webView, identifier, webError.get(), getWebDataSource(loader)); } +bool WebFrameLoaderClient::shouldCacheResponse(DocumentLoader* loader, unsigned long identifier, const ResourceResponse& response, const unsigned char* data, const unsigned long long length) +{ + WebView* webView = m_webFrame->webView(); + COMPtr<IWebResourceLoadDelegate> resourceLoadDelegate; + if (FAILED(webView->resourceLoadDelegate(&resourceLoadDelegate))) + return true; + + COMPtr<IWebResourceLoadDelegatePrivate3> resourceLoadDelegatePrivate(Query, resourceLoadDelegate); + if (!resourceLoadDelegatePrivate) + return true; + + COMPtr<IWebURLResponse> urlResponse(WebURLResponse::createInstance(response)); + BOOL shouldCache; + if (SUCCEEDED(resourceLoadDelegatePrivate->shouldCacheResponse(webView, identifier, urlResponse.get(), data, length, getWebDataSource(loader), &shouldCache))) + return shouldCache; + + return true; +} + void WebFrameLoaderClient::dispatchDidHandleOnloadEvents() { WebView* webView = m_webFrame->webView(); @@ -457,27 +481,31 @@ void WebFrameLoaderClient::updateGlobalHistory() return; DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader(); - - if (loader->urlForHistoryReflectsServerRedirect()) { - history->visitedURL(loader->urlForHistory(), loader->title(), loader->request().httpMethod(), loader->urlForHistoryReflectsFailure(), loader->url(), false); - return; - } - - if (loader->urlForHistoryReflectsClientRedirect()) { - history->visitedURL(loader->urlForHistory(), loader->title(), loader->request().httpMethod(), loader->urlForHistoryReflectsFailure(), KURL(), true); - return; - } - - history->visitedURL(loader->urlForHistory(), loader->title(), loader->request().httpMethod(), loader->urlForHistoryReflectsFailure(), KURL(), false); + history->visitedURL(loader->urlForHistory(), loader->title(), loader->originalRequestCopy().httpMethod(), loader->urlForHistoryReflectsFailure()); + updateGlobalHistoryRedirectLinks(); } -void WebFrameLoaderClient::updateGlobalHistoryForRedirectWithoutHistoryItem() +void WebFrameLoaderClient::updateGlobalHistoryRedirectLinks() { WebHistory* history = WebHistory::sharedHistory(); if (!history) return; + DocumentLoader* loader = core(m_webFrame)->loader()->documentLoader(); - history->visitedURLForRedirectWithoutHistoryItem(loader->url()); + + if (!loader->clientRedirectSourceForHistory().isNull()) { + if (COMPtr<IWebHistoryItem> iWebHistoryItem = history->itemForURLString(loader->clientRedirectSourceForHistory())) { + COMPtr<WebHistoryItem> webHistoryItem(Query, iWebHistoryItem); + webHistoryItem->historyItem()->addRedirectURL(loader->clientRedirectDestinationForHistory()); + } + } + + if (!loader->serverRedirectSourceForHistory().isNull()) { + if (COMPtr<IWebHistoryItem> iWebHistoryItem = history->itemForURLString(loader->serverRedirectSourceForHistory())) { + COMPtr<WebHistoryItem> webHistoryItem(Query, iWebHistoryItem); + webHistoryItem->historyItem()->addRedirectURL(loader->serverRedirectDestinationForHistory()); + } + } } bool WebFrameLoaderClient::shouldGoToHistoryItem(HistoryItem*) const @@ -548,7 +576,7 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage() view->frameRect(&rect); bool transparent = view->transparent(); Color backgroundColor = transparent ? Color::transparent : Color::white; - WebCore::FrameLoaderClient::transitionToCommittedForNewPage(core(m_webFrame), IntRect(rect).size(), backgroundColor, transparent, IntSize(), false); + core(m_webFrame)->createView(IntRect(rect).size(), backgroundColor, transparent, IntSize(), false); } bool WebFrameLoaderClient::canCachePage() const @@ -627,7 +655,7 @@ void WebFrameLoaderClient::loadURLIntoChild(const KURL& originalURL, const Strin core(childFrame)->loader()->loadURL(url, referrer, frameName, false, childLoadType, 0, 0); } -Widget* WebFrameLoaderClient::createPlugin(const IntSize& pluginSize, Element* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually) +Widget* WebFrameLoaderClient::createPlugin(const IntSize& pluginSize, HTMLPlugInElement* element, const KURL& url, const Vector<String>& paramNames, const Vector<String>& paramValues, const String& mimeType, bool loadManually) { WebView* webView = m_webFrame->webView(); diff --git a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h index 3877273..ac7a8c7 100644 --- a/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h +++ b/WebKit/win/WebCoreSupport/WebFrameLoaderClient.h @@ -56,6 +56,7 @@ public: virtual void dispatchDidReceiveContentLength(WebCore::DocumentLoader*, unsigned long identifier, int lengthReceived); virtual void dispatchDidFinishLoading(WebCore::DocumentLoader*, unsigned long identifier); virtual void dispatchDidFailLoading(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceError&); + virtual bool shouldCacheResponse(WebCore::DocumentLoader*, unsigned long identifier, const WebCore::ResourceResponse&, const unsigned char* data, unsigned long long length); virtual void dispatchDidHandleOnloadEvents(); virtual void dispatchDidReceiveServerRedirectForProvisionalLoad(); @@ -86,7 +87,7 @@ public: virtual void finishedLoading(WebCore::DocumentLoader*); virtual void updateGlobalHistory(); - virtual void updateGlobalHistoryForRedirectWithoutHistoryItem(); + virtual void updateGlobalHistoryRedirectLinks(); virtual bool shouldGoToHistoryItem(WebCore::HistoryItem*) const; virtual PassRefPtr<WebCore::DocumentLoader> createDocumentLoader(const WebCore::ResourceRequest&, const WebCore::SubstituteData&); @@ -100,7 +101,7 @@ public: virtual PassRefPtr<WebCore::Frame> createFrame(const WebCore::KURL& url, const WebCore::String& name, WebCore::HTMLFrameOwnerElement* ownerElement, const WebCore::String& referrer, bool allowsScrolling, int marginWidth, int marginHeight); - virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::Element*, const WebCore::KURL&, const Vector<WebCore::String>&, const Vector<WebCore::String>&, const WebCore::String&, bool loadManually); + virtual WebCore::Widget* createPlugin(const WebCore::IntSize&, WebCore::HTMLPlugInElement*, const WebCore::KURL&, const Vector<WebCore::String>&, const Vector<WebCore::String>&, const WebCore::String&, bool loadManually); virtual void redirectDataToPlugin(WebCore::Widget* pluginWidget); virtual bool shouldUsePluginDocument(const WebCore::String& mimeType) const; diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp index 56cf0df..5bb1a83 100644 --- a/WebKit/win/WebCoreSupport/WebInspectorClient.cpp +++ b/WebKit/win/WebCoreSupport/WebInspectorClient.cpp @@ -201,6 +201,13 @@ String WebInspectorClient::localizedStringsURL() return CFURLGetString(url.get()); } + +String WebInspectorClient::hiddenPanels() +{ + // FIXME: implement this + return String(); +} + void WebInspectorClient::showWindow() { showWindowWithoutNotifications(); diff --git a/WebKit/win/WebCoreSupport/WebInspectorClient.h b/WebKit/win/WebCoreSupport/WebInspectorClient.h index 86317f6..b497788 100644 --- a/WebKit/win/WebCoreSupport/WebInspectorClient.h +++ b/WebKit/win/WebCoreSupport/WebInspectorClient.h @@ -50,6 +50,8 @@ public: virtual WebCore::String localizedStringsURL(); + virtual WebCore::String hiddenPanels(); + virtual void showWindow(); virtual void closeWindow(); virtual bool windowVisible(); |