summaryrefslogtreecommitdiffstats
path: root/WebKit/android/WebCoreSupport
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-04-25 18:36:43 -0700
committerSteve Block <steveblock@google.com>2010-04-27 17:09:11 +0100
commit5b71639dd156f6224bbb25ed257ac70374641f6b (patch)
treea465465d7c99ea3fc561eb9bc9c1d472921aea1f /WebKit/android/WebCoreSupport
parentaf051345af6893a284d0ce367aa92a6d8a977f38 (diff)
downloadexternal_webkit-5b71639dd156f6224bbb25ed257ac70374641f6b.zip
external_webkit-5b71639dd156f6224bbb25ed257ac70374641f6b.tar.gz
external_webkit-5b71639dd156f6224bbb25ed257ac70374641f6b.tar.bz2
Merge webkit.org at r55033 : Implement FrameLoaderClient::didTransferChildFrameToNewDocument for Android
This method is required because the latest version of WebKit adds the ability for an existing Frame object to be relocated in the DOM. See http://trac.webkit.org/changeset/54938 and http://trac.webkit.org/changeset/53871 Change-Id: I18aaae5f6db005b7a0d29c3d783207fa37548572
Diffstat (limited to 'WebKit/android/WebCoreSupport')
-rw-r--r--WebKit/android/WebCoreSupport/ChromeClientAndroid.h1
-rw-r--r--WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp17
-rw-r--r--WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h8
3 files changed, 21 insertions, 5 deletions
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
index 2797bc9..0e4d5c9 100644
--- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
+++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
@@ -161,6 +161,7 @@ namespace android {
// Android-specific
void setWebFrame(android::WebFrame* webframe);
+ android::WebFrame* webFrame() { return m_webFrame; }
void wakeUpMainThreadWithNewQuota(long newQuota);
#if USE(ACCELERATED_COMPOSITING)
diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
index 9112afe..a0b8475 100644
--- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.cpp
@@ -32,6 +32,8 @@
#include "CString.h"
#include "CachedFrame.h"
#include "CachedFramePlatformDataAndroid.h"
+#include "Chrome.h"
+#include "ChromeClientAndroid.h"
#include "DOMImplementation.h"
#include "Document.h"
#include "DocumentLoader.h"
@@ -1215,6 +1217,21 @@ WTF::PassRefPtr<Widget> FrameLoaderClientAndroid::createJavaAppletWidget(const I
return 0;
}
+void FrameLoaderClientAndroid::didTransferChildFrameToNewDocument()
+{
+ ASSERT(m_frame);
+ // m_webFrame points to the WebFrame for the page that our frame previosuly
+ // belonged to. If the frame now belongs to a new page, we need to update
+ // m_webFrame to point to the WebFrame for the new page.
+ Page* newPage = m_frame->page();
+ if (newPage != m_webFrame->page()) {
+ ChromeClientAndroid* chromeClient = static_cast<ChromeClientAndroid*>(newPage->chrome()->client());
+ Release(m_webFrame);
+ m_webFrame = chromeClient->webFrame();
+ Retain(m_webFrame);
+ }
+}
+
// This function is used by the <OBJECT> element to determine the type of
// the contents and work out if it can render it.
ObjectContentType FrameLoaderClientAndroid::objectContentType(const KURL& url,
diff --git a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
index 3b754b8..fe58124 100644
--- a/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
+++ b/WebKit/android/WebCoreSupport/FrameLoaderClientAndroid.h
@@ -176,11 +176,9 @@ namespace android {
virtual bool canCachePage() const;
virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&);
- virtual WTF::PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement,
- const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
- virtual WTF::PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&,
- const WTF::Vector<String>&, const WTF::Vector<String>&,
- const String&, bool loadManually);
+ virtual WTF::PassRefPtr<Frame> createFrame(const KURL& url, const String& name, HTMLFrameOwnerElement* ownerElement, const String& referrer, bool allowsScrolling, int marginWidth, int marginHeight);
+ virtual void didTransferChildFrameToNewDocument();
+ virtual WTF::PassRefPtr<Widget> createPlugin(const IntSize&, HTMLPlugInElement*, const KURL&, const WTF::Vector<String>&, const WTF::Vector<String>&, const String&, bool loadManually);
virtual void redirectDataToPlugin(Widget* pluginWidget);
virtual WTF::PassRefPtr<Widget> createJavaAppletWidget(const IntSize&, HTMLAppletElement*, const KURL& baseURL, const WTF::Vector<String>& paramNames, const WTF::Vector<String>& paramValues);