From a89b2ebb8e192c5e8cea21079bda2ee2c0c7dddd Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 25 May 2012 15:09:11 +0200 Subject: Imported WebKit commit eb5c1b8fe4d4b1b90b5137433fc58a91da0e6878 (http://svn.webkit.org/repository/webkit/trunk@118516) --- Source/WebKit/chromium/src/WebPagePopupImpl.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Source/WebKit/chromium/src/WebPagePopupImpl.cpp') diff --git a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp index 1ad417bad..617b725ce 100644 --- a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp +++ b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp @@ -32,6 +32,7 @@ #include "WebPagePopupImpl.h" #include "Chrome.h" +#include "DOMWindowPagePopup.h" #include "EmptyClients.h" #include "FileChooser.h" #include "FocusController.h" @@ -127,6 +128,10 @@ private: WebPagePopupImpl* m_popup; }; +class PagePopupFrameLoaderClient : public EmptyFrameLoaderClient { + virtual bool allowPagePopup() OVERRIDE { return true; } +}; + // WebPagePopupImpl ---------------------------------------------------------------- WebPagePopupImpl::WebPagePopupImpl(WebWidgetClient* client) @@ -181,8 +186,8 @@ bool WebPagePopupImpl::initPage() m_page->settings()->setScriptEnabled(true); m_page->settings()->setAllowScriptsToCloseWindows(true); - static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClient; - RefPtr frame = Frame::create(m_page.get(), 0, emptyFrameLoaderClient); + static FrameLoaderClient* pagePopupFrameLoaderClient = new PagePopupFrameLoaderClient; + RefPtr frame = Frame::create(m_page.get(), 0, pagePopupFrameLoaderClient); frame->setView(FrameView::create(frame.get())); frame->init(); frame->view()->resize(m_popupClient->contentSize()); @@ -195,7 +200,8 @@ bool WebPagePopupImpl::initPage() m_popupClient->writeDocument(*writer); writer->end(); - frame->script()->installFunctionsForPagePopup(frame.get(), m_popupClient); + ASSERT(frame->existingDOMWindow()); + DOMWindowPagePopup::install(frame->existingDOMWindow(), m_popupClient); return true; } -- cgit v1.2.1