diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:01:08 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-06-20 13:01:08 +0200 |
commit | 49233e234e5c787396cadb2cea33b31ae0cd65c1 (patch) | |
tree | 5410cb9a8fd53168bb60d62c54b654d86f03c38d /Source/WebKit/chromium/src/WebPagePopupImpl.cpp | |
parent | b211c645d8ab690f713515dfdc84d80b11c27d2c (diff) | |
download | qtwebkit-49233e234e5c787396cadb2cea33b31ae0cd65c1.tar.gz |
Imported WebKit commit 3a8c29f35d00659d2ce7a0ccdfa8304f14e82327 (http://svn.webkit.org/repository/webkit/trunk@120813)
New snapshot with Windows build fixes
Diffstat (limited to 'Source/WebKit/chromium/src/WebPagePopupImpl.cpp')
-rw-r--r-- | Source/WebKit/chromium/src/WebPagePopupImpl.cpp | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp index 617b725ce..6d59cc19c 100644 --- a/Source/WebKit/chromium/src/WebPagePopupImpl.cpp +++ b/Source/WebKit/chromium/src/WebPagePopupImpl.cpp @@ -32,18 +32,16 @@ #include "WebPagePopupImpl.h" #include "Chrome.h" +#include "ContextFeatures.h" #include "DOMWindowPagePopup.h" +#include "DocumentLoader.h" #include "EmptyClients.h" -#include "FileChooser.h" #include "FocusController.h" -#include "FormState.h" #include "FrameView.h" -#include "HTMLFormElement.h" #include "Page.h" #include "PagePopupClient.h" #include "PageWidgetDelegate.h" #include "Settings.h" -#include "WebInputEvent.h" #include "WebInputEventConversion.h" #include "WebPagePopup.h" #include "WebViewImpl.h" @@ -128,10 +126,17 @@ private: WebPagePopupImpl* m_popup; }; -class PagePopupFrameLoaderClient : public EmptyFrameLoaderClient { - virtual bool allowPagePopup() OVERRIDE { return true; } +class PagePopupFeaturesClient : public ContextFeaturesClient { + virtual bool isEnabled(Document*, ContextFeatures::FeatureType, bool) OVERRIDE; }; +bool PagePopupFeaturesClient::isEnabled(Document*, ContextFeatures::FeatureType type, bool defaultValue) +{ + if (type == ContextFeatures::PagePopup) + return true; + return defaultValue; +} + // WebPagePopupImpl ---------------------------------------------------------------- WebPagePopupImpl::WebPagePopupImpl(WebWidgetClient* client) @@ -186,8 +191,10 @@ bool WebPagePopupImpl::initPage() m_page->settings()->setScriptEnabled(true); m_page->settings()->setAllowScriptsToCloseWindows(true); - static FrameLoaderClient* pagePopupFrameLoaderClient = new PagePopupFrameLoaderClient; - RefPtr<Frame> frame = Frame::create(m_page.get(), 0, pagePopupFrameLoaderClient); + static ContextFeaturesClient* pagePopupFeaturesClient = new PagePopupFeaturesClient(); + provideContextFeaturesTo(m_page.get(), pagePopupFeaturesClient); + static FrameLoaderClient* emptyFrameLoaderClient = new EmptyFrameLoaderClient(); + RefPtr<Frame> frame = Frame::create(m_page.get(), 0, emptyFrameLoaderClient); frame->setView(FrameView::create(frame.get())); frame->init(); frame->view()->resize(m_popupClient->contentSize()); @@ -230,7 +237,7 @@ void WebPagePopupImpl::layout() void WebPagePopupImpl::paint(WebCanvas* canvas, const WebRect& rect) { - PageWidgetDelegate::paint(m_page.get(), 0, canvas, rect); + PageWidgetDelegate::paint(m_page.get(), 0, canvas, rect, PageWidgetDelegate::Opaque); } void WebPagePopupImpl::resize(const WebSize& newSize) @@ -287,6 +294,8 @@ void WebPagePopupImpl::setFocus(bool enable) void WebPagePopupImpl::close() { + if (m_page && m_page->mainFrame()) + m_page->mainFrame()->loader()->frameDetached(); m_page.clear(); m_widgetClient = 0; deref(); |