summaryrefslogtreecommitdiffstats
path: root/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2016-08-25 19:20:41 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-02-02 12:30:55 +0000
commit6882a04fb36642862b11efe514251d32070c3d65 (patch)
treeb7959826000b061fd5ccc7512035c7478742f7b0 /Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp
parentab6df191029eeeb0b0f16f127d553265659f739e (diff)
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp')
-rw-r--r--Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp39
1 files changed, 21 insertions, 18 deletions
diff --git a/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp
index 0becc77eb..fffa8b2d5 100644
--- a/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp
+++ b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp
@@ -34,8 +34,8 @@
#include "WebPage.h"
#include <WebCore/Color.h>
#include <WebCore/Element.h>
-#include <WebCore/Frame.h>
#include <WebCore/FrameView.h>
+#include <WebCore/MainFrame.h>
#include <WebCore/Page.h>
#include <WebCore/RenderLayer.h>
#include <WebCore/RenderLayerBacking.h>
@@ -50,23 +50,23 @@ namespace WebKit {
static IntRect screenRectOfContents(Element* element)
{
ASSERT(element);
-#if USE(ACCELERATED_COMPOSITING)
if (element->renderer() && element->renderer()->hasLayer() && element->renderer()->enclosingLayer()->isComposited()) {
FloatQuad contentsBox = static_cast<FloatRect>(element->renderer()->enclosingLayer()->backing()->contentsBox());
contentsBox = element->renderer()->localToAbsoluteQuad(contentsBox);
- return element->renderer()->view()->frameView()->contentsToScreen(contentsBox.enclosingBoundingBox());
+ return element->renderer()->view().frameView().contentsToScreen(contentsBox.enclosingBoundingBox());
}
-#endif
+
return element->screenRect();
}
-PassRefPtr<WebFullScreenManager> WebFullScreenManager::create(WebPage* page)
+Ref<WebFullScreenManager> WebFullScreenManager::create(WebPage* page)
{
- return adoptRef(new WebFullScreenManager(page));
+ return adoptRef(*new WebFullScreenManager(page));
}
WebFullScreenManager::WebFullScreenManager(WebPage* page)
- : m_page(page)
+ : m_topContentInset(0)
+ , m_page(page)
{
}
@@ -79,14 +79,14 @@ WebCore::Element* WebFullScreenManager::element()
return m_element.get();
}
-void WebFullScreenManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageDecoder& decoder)
+void WebFullScreenManager::didReceiveMessage(IPC::Connection& connection, IPC::MessageDecoder& decoder)
{
didReceiveWebFullScreenManagerMessage(connection, decoder);
}
bool WebFullScreenManager::supportsFullScreen(bool withKeyboard)
{
- if (!m_page->corePage()->settings()->fullScreenEnabled())
+ if (!m_page->corePage()->settings().fullScreenEnabled())
return false;
return m_page->injectedBundleFullScreenClient().supportsFullScreen(m_page.get(), withKeyboard);
@@ -108,9 +108,9 @@ void WebFullScreenManager::exitFullScreenForElement(WebCore::Element* element)
void WebFullScreenManager::willEnterFullScreen()
{
ASSERT(m_element);
- m_element->document()->webkitWillEnterFullScreenForElement(m_element.get());
+ m_element->document().webkitWillEnterFullScreenForElement(m_element.get());
m_page->hidePageBanners();
- m_element->document()->updateLayout();
+ m_element->document().updateLayout();
m_page->forceRepaintWithoutCallback();
m_finalFrame = screenRectOfContents(m_element.get());
m_page->injectedBundleFullScreenClient().beganEnterFullScreen(m_page.get(), m_initialFrame, m_finalFrame);
@@ -119,14 +119,14 @@ void WebFullScreenManager::willEnterFullScreen()
void WebFullScreenManager::didEnterFullScreen()
{
ASSERT(m_element);
- m_element->document()->webkitDidEnterFullScreenForElement(m_element.get());
+ m_element->document().webkitDidEnterFullScreenForElement(m_element.get());
}
void WebFullScreenManager::willExitFullScreen()
{
ASSERT(m_element);
m_finalFrame = screenRectOfContents(m_element.get());
- m_element->document()->webkitWillExitFullScreenForElement(m_element.get());
+ m_element->document().webkitWillExitFullScreenForElement(m_element.get());
m_page->showPageBanners();
m_page->injectedBundleFullScreenClient().beganExitFullScreen(m_page.get(), m_finalFrame, m_initialFrame);
}
@@ -134,19 +134,19 @@ void WebFullScreenManager::willExitFullScreen()
void WebFullScreenManager::didExitFullScreen()
{
ASSERT(m_element);
- m_element->document()->webkitDidExitFullScreenForElement(m_element.get());
+ m_element->document().webkitDidExitFullScreenForElement(m_element.get());
}
void WebFullScreenManager::setAnimatingFullScreen(bool animating)
{
ASSERT(m_element);
- m_element->document()->setAnimatingFullScreen(animating);
+ m_element->document().setAnimatingFullScreen(animating);
}
void WebFullScreenManager::requestExitFullScreen()
{
ASSERT(m_element);
- m_element->document()->webkitCancelFullScreen();
+ m_element->document().webkitCancelFullScreen();
}
void WebFullScreenManager::close()
@@ -156,12 +156,15 @@ void WebFullScreenManager::close()
void WebFullScreenManager::saveScrollPosition()
{
- m_scrollPosition = m_page->corePage()->mainFrame()->view()->scrollPosition();
+ m_scrollPosition = m_page->corePage()->mainFrame().view()->scrollPosition();
+ m_topContentInset = m_page->corePage()->topContentInset();
+ m_page->corePage()->setTopContentInset(0);
}
void WebFullScreenManager::restoreScrollPosition()
{
- m_page->corePage()->mainFrame()->view()->setScrollPosition(m_scrollPosition);
+ m_page->corePage()->setTopContentInset(m_topContentInset);
+ m_page->corePage()->mainFrame().view()->setScrollPosition(m_scrollPosition);
}
} // namespace WebKit