summaryrefslogtreecommitdiff
path: root/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-05-11 09:43:24 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-05-11 09:43:24 +0200
commit1b914638db989aaa98631a1c1e02c7b2d44805d8 (patch)
tree87f4fd2c7b38db320079a5de8877890d2ca3c485 /Source/WebKit2/WebProcess/WebPage/WebPage.cpp
parent2cf6c8816a73e0132bd8fa3b509d62d7c51b6e47 (diff)
downloadqtwebkit-1b914638db989aaa98631a1c1e02c7b2d44805d8.tar.gz
Imported WebKit commit 9a52e27980f47e8b0d8f8b7cc0fd7b5741bceb92 (http://svn.webkit.org/repository/webkit/trunk@116736)
New snapshot to include QDeclarative* -> QQml* build fixes
Diffstat (limited to 'Source/WebKit2/WebProcess/WebPage/WebPage.cpp')
-rw-r--r--Source/WebKit2/WebProcess/WebPage/WebPage.cpp40
1 files changed, 37 insertions, 3 deletions
diff --git a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
index 717f67371..413d0d7ab 100644
--- a/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -91,6 +91,7 @@
#include <WebCore/FrameView.h>
#include <WebCore/HTMLFormElement.h>
#include <WebCore/HTMLInputElement.h>
+#include <WebCore/HTMLPlugInElement.h>
#include <WebCore/HistoryItem.h>
#include <WebCore/KeyboardEvent.h>
#include <WebCore/MouseEvent.h>
@@ -224,6 +225,9 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
#if PLATFORM(WIN)
, m_gestureReachedScrollingLimit(false)
#endif
+#if ENABLE(PAGE_VISIBILITY_API)
+ , m_visibilityState(WebCore::PageVisibilityStateVisible)
+#endif
{
ASSERT(m_pageID);
// FIXME: This is a non-ideal location for this Setting and
@@ -382,13 +386,22 @@ void WebPage::initializeInjectedBundleFullScreenClient(WKBundlePageFullScreenCli
}
#endif
-PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, const Plugin::Parameters& parameters)
+PassRefPtr<Plugin> WebPage::createPlugin(WebFrame* frame, HTMLPlugInElement* pluginElement, const Plugin::Parameters& parameters)
{
String pluginPath;
+ bool blocked;
if (!WebProcess::shared().connection()->sendSync(
Messages::WebContext::GetPluginPath(parameters.mimeType, parameters.url.string()),
- Messages::WebContext::GetPluginPath::Reply(pluginPath), 0)) {
+ Messages::WebContext::GetPluginPath::Reply(pluginPath, blocked), 0)) {
+ return 0;
+ }
+
+ if (blocked) {
+ if (pluginElement->renderer()->isEmbeddedObject())
+ toRenderEmbeddedObject(pluginElement->renderer())->setPluginUnavailabilityReason(RenderEmbeddedObject::InsecurePluginVersion);
+
+ send(Messages::WebPageProxy::DidBlockInsecurePluginVersion(parameters.mimeType));
return 0;
}
@@ -3157,7 +3170,28 @@ void WebPage::setVisibilityState(int visibilityState, bool isInitialState)
{
if (!m_page)
return;
- m_page->setVisibilityState(static_cast<WebCore::PageVisibilityState>(visibilityState), isInitialState);
+
+ WebCore::PageVisibilityState state = static_cast<WebCore::PageVisibilityState>(visibilityState);
+
+ if (m_visibilityState == state)
+ return;
+
+ FrameView* view = m_page->mainFrame() ? m_page->mainFrame()->view() : 0;
+
+ if (state == WebCore::PageVisibilityStateVisible) {
+ m_page->didMoveOnscreen();
+ if (view)
+ view->show();
+ }
+
+ m_page->setVisibilityState(state, isInitialState);
+ m_visibilityState = state;
+
+ if (state == WebCore::PageVisibilityStateHidden) {
+ m_page->willMoveOffscreen();
+ if (view)
+ view->hide();
+ }
}
#endif