diff options
Diffstat (limited to 'WebKit/android/WebCoreSupport')
3 files changed, 42 insertions, 9 deletions
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h index e75393b..15473ca 100644 --- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h +++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h @@ -143,6 +143,7 @@ namespace android { // Methods used to request and provide Geolocation permissions. virtual void requestGeolocationPermissionForFrame(Frame*, Geolocation*); + virtual void cancelGeolocationPermissionRequestForFrame(Frame*) { } // Android-specific void provideGeolocationPermissions(const String &origin, bool allow, bool remember); void storeGeolocationPermissions(); diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp index 761490a..be68106 100644 --- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp +++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp @@ -80,7 +80,9 @@ static const int EXTRA_LAYOUT_DELAY = 1000; FrameLoaderClientAndroid::FrameLoaderClientAndroid(WebFrame* webframe) : m_frame(NULL) - , m_webFrame(webframe) { + , m_webFrame(webframe) + , m_manualLoader(NULL) + , m_hasSentResponseToPlugin(false) { Retain(m_webFrame); } @@ -560,9 +562,15 @@ void FrameLoaderClientAndroid::revertToProvisionalState(DocumentLoader*) { void FrameLoaderClientAndroid::setMainDocumentError(DocumentLoader* docLoader, const ResourceError& error) { ASSERT(m_frame); - if (!error.isNull() && error.errorCode() >= InternalErrorLast) - m_webFrame->reportError(error.errorCode(), - error.localizedDescription(), error.failingURL()); + if (m_manualLoader) { + m_manualLoader->didFail(error); + m_manualLoader = NULL; + m_hasSentResponseToPlugin = false; + } else { + if (!error.isNull() && error.errorCode() >= InternalErrorLast) + m_webFrame->reportError(error.errorCode(), + error.localizedDescription(), error.failingURL()); + } } // This function is called right before the progress is updated. @@ -624,7 +632,14 @@ void FrameLoaderClientAndroid::finishedLoading(DocumentLoader* docLoader) { // Telling the frame we received some data and passing 0 as the data is our // way to get work done that is normally done when the first bit of data is // received, even for the case of a document with no data (like about:blank) - committedLoad(docLoader, 0, 0); + if (!m_manualLoader) { + committedLoad(docLoader, 0, 0); + return; + } + + m_manualLoader->didFinishLoading(); + m_manualLoader = NULL; + m_hasSentResponseToPlugin = false; } void FrameLoaderClientAndroid::updateGlobalHistory() { @@ -667,6 +682,18 @@ void FrameLoaderClientAndroid::didRunInsecureContent(SecurityOrigin*) void FrameLoaderClientAndroid::committedLoad(DocumentLoader* loader, const char* data, int length) { ASSERT(m_frame); + if (m_manualLoader) { + if (!m_hasSentResponseToPlugin) { + m_manualLoader->didReceiveResponse(loader->response()); + // Failure could cause the main document to have an error causing + // the manual loader to be reset. + if (!m_manualLoader) + return; + m_hasSentResponseToPlugin = true; + } + m_manualLoader->didReceiveData(data, length); + return; + } String encoding = loader->overrideEncoding(); bool userChosen = !encoding.isNull(); if (encoding.isNull()) @@ -1021,8 +1048,7 @@ WTF::PassRefPtr<Widget> FrameLoaderClientAndroid::createPlugin( } void FrameLoaderClientAndroid::redirectDataToPlugin(Widget* pluginWidget) { - // don't support plugin yet - notImplemented(); + m_manualLoader = static_cast<PluginView*>(pluginWidget); } WTF::PassRefPtr<Widget> FrameLoaderClientAndroid::createJavaAppletWidget(const IntSize&, HTMLAppletElement*, diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h index ddf0deb..2fb552c 100644 --- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h +++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h @@ -31,6 +31,10 @@ #include "ResourceResponse.h" #include "WebIconDatabase.h" +namespace WebCore { +class PluginManualLoader; +} + using namespace WebCore; namespace android { @@ -205,9 +209,11 @@ namespace android { // FIXME: this doesn't really go here, but it's better than Frame CacheBuilder& getCacheBuilder() { return m_cacheBuilder; } private: - CacheBuilder m_cacheBuilder; + CacheBuilder m_cacheBuilder; Frame* m_frame; - WebFrame* m_webFrame; + WebFrame* m_webFrame; + PluginManualLoader* m_manualLoader; + bool m_hasSentResponseToPlugin; enum ResourceErrors { InternalErrorCancelled = -99, |
