Skip to content
Permalink
Browse files
[WK2][EFL] Move PageViewportController and PageViewportControllerClie…
…ntEfl out from WebView

https://bugs.webkit.org/show_bug.cgi?id=110345

Reviewed by Andreas Kling.

WebView does not need to know about both PageViewportController and
PageViewportControllerClientEfl. Considering the fact that PageViewportController
will stop being WK2 internal and will be based on WK2 C API, it
should be owned by EwkView rather than WebView.

This patch is also a preparation for WKViewClient API extension to cover all
the places where PageViewportController and PageViewportControllerClientEfl
are accessed directly from WebView at the moment.

* UIProcess/API/efl/EwkView.cpp:
(EwkView::EwkView):
* UIProcess/API/efl/EwkView.h:
(WebKit):
(EwkView::pageViewportControllerClient):
(EwkView::pageViewportController):
(EwkView):
* UIProcess/efl/WebView.cpp:
(WebKit::WebView::didCommitLoad):
(WebKit::WebView::updateViewportSize):
(WebKit::WebView::didChangeContentsSize):
(WebKit::WebView::didChangeViewportProperties):
(WebKit::WebView::pageDidRequestScroll):
(WebKit::WebView::didRenderFrame):
(WebKit::WebView::pageTransitionViewportReady):
* UIProcess/efl/WebView.h:
(WebView):


Canonical link: https://commits.webkit.org/128733@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143582 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Mikhail Pozdnyakov committed Feb 21, 2013
1 parent bba5260 commit b66983afa617e4f25a5080007afe14a9c095df75
Showing 5 changed files with 71 additions and 37 deletions.
@@ -1,3 +1,37 @@
2013-02-21 Mikhail Pozdnyakov <mikhail.pozdnyakov@intel.com>

[WK2][EFL] Move PageViewportController and PageViewportControllerClientEfl out from WebView
https://bugs.webkit.org/show_bug.cgi?id=110345

Reviewed by Andreas Kling.

WebView does not need to know about both PageViewportController and
PageViewportControllerClientEfl. Considering the fact that PageViewportController
will stop being WK2 internal and will be based on WK2 C API, it
should be owned by EwkView rather than WebView.

This patch is also a preparation for WKViewClient API extension to cover all
the places where PageViewportController and PageViewportControllerClientEfl
are accessed directly from WebView at the moment.

* UIProcess/API/efl/EwkView.cpp:
(EwkView::EwkView):
* UIProcess/API/efl/EwkView.h:
(WebKit):
(EwkView::pageViewportControllerClient):
(EwkView::pageViewportController):
(EwkView):
* UIProcess/efl/WebView.cpp:
(WebKit::WebView::didCommitLoad):
(WebKit::WebView::updateViewportSize):
(WebKit::WebView::didChangeContentsSize):
(WebKit::WebView::didChangeViewportProperties):
(WebKit::WebView::pageDidRequestScroll):
(WebKit::WebView::didRenderFrame):
(WebKit::WebView::pageTransitionViewportReady):
* UIProcess/efl/WebView.h:
(WebView):

2013-02-20 Tim Horton <timothy_horton@apple.com>

Provide WKView SPI to defer telling the WebPageProxy and WebProcess about changes in the hosting window
@@ -33,6 +33,8 @@
#include "PageLoadClientEfl.h"
#include "PagePolicyClientEfl.h"
#include "PageUIClientEfl.h"
#include "PageViewportController.h"
#include "PageViewportControllerClientEfl.h"
#include "SnapshotImageGL.h"
#include "ViewClientEfl.h"
#include "WKDictionary.h"
@@ -253,6 +255,8 @@ EwkView::EwkView(Evas_Object* evasObject, PassRefPtr<EwkContext> context, WKPage
#endif
, m_displayTimer(this, &EwkView::displayTimerFired)
, m_inputMethodContext(InputMethodContextEfl::create(this, smartData()->base.evas))
, m_pageViewportControllerClient(PageViewportControllerClientEfl::create(this))
, m_pageViewportController(adoptPtr(new PageViewportController(page(), m_pageViewportControllerClient.get())))
, m_isAccelerated(true)
{
ASSERT(m_evasObject);
@@ -63,6 +63,8 @@ class PageLoadClientEfl;
class PagePolicyClientEfl;
class PageUIClientEfl;
class ViewClientEfl;
class PageViewportController;
class PageViewportControllerClientEfl;
class WebContextMenuItemData;
class WebContextMenuProxyEfl;
class WebPageGroup;
@@ -122,6 +124,8 @@ class EwkView {
EwkSettings* settings() { return m_settings.get(); }
EwkBackForwardList* backForwardList() { return m_backForwardList.get(); }
EwkWindowFeatures* windowFeatures();
WebKit::PageViewportControllerClientEfl* pageViewportControllerClient() { return m_pageViewportControllerClient.get(); }
WebKit::PageViewportController* pageViewportController() { return m_pageViewportController.get(); }

bool isFocused() const;
bool isVisible() const;
@@ -301,6 +305,8 @@ class EwkView {
#if ENABLE(INPUT_TYPE_COLOR)
OwnPtr<EwkColorPicker> m_colorPicker;
#endif
OwnPtr<WebKit::PageViewportControllerClientEfl> m_pageViewportControllerClient;
OwnPtr<WebKit::PageViewportController> m_pageViewportController;
bool m_isAccelerated;

static Evas_Smart_Class parentSmartClass;
@@ -143,29 +143,26 @@ void WebView::initializeClient(const WKViewClient* client)
void WebView::didCommitLoad()
{
if (m_page->useFixedLayout()) {
ASSERT(m_pageViewportController);
m_pageViewportController->didCommitLoad();
} else
m_ewkView->scheduleUpdateDisplay();
m_ewkView->pageViewportController()->didCommitLoad();
return;
}
m_ewkView->scheduleUpdateDisplay();
}

void WebView::updateViewportSize()
{
if (m_page->useFixedLayout()) {
if (!m_pageViewportControllerClient) {
m_pageViewportControllerClient = PageViewportControllerClientEfl::create(m_ewkView);
m_pageViewportController = adoptPtr(new PageViewportController(page(), m_pageViewportControllerClient.get()));
}
m_pageViewportControllerClient->updateViewportSize();
} else
m_page->drawingArea()->setVisibleContentsRect(IntRect(roundedIntPoint(m_ewkView->pagePosition()), m_ewkView->size()), FloatPoint());
m_ewkView->pageViewportControllerClient()->updateViewportSize();
return;
}
m_page->drawingArea()->setVisibleContentsRect(IntRect(roundedIntPoint(m_ewkView->pagePosition()), m_ewkView->size()), FloatPoint());
}

void WebView::didChangeContentsSize(const WebCore::IntSize& size)
{
if (m_page->useFixedLayout()) {
ASSERT(m_pageViewportController);
m_pageViewportController->didChangeContentsSize(size);
m_ewkView->pageViewportController()->didChangeContentsSize(size);
return;
}
m_client.didChangeContentsSize(this, size);
}
@@ -431,39 +428,38 @@ FloatRect WebView::convertToUserSpace(const FloatRect& deviceRect)
void WebView::didChangeViewportProperties(const WebCore::ViewportAttributes& attr)
{
if (m_page->useFixedLayout()) {
ASSERT(m_pageViewportController);
m_pageViewportController->didChangeViewportAttributes(attr);
} else
m_ewkView->scheduleUpdateDisplay();
m_ewkView->pageViewportController()->didChangeViewportAttributes(attr);
return;
}
m_ewkView->scheduleUpdateDisplay();
}

void WebView::pageDidRequestScroll(const IntPoint& position)
{
if (m_page->useFixedLayout()) {
ASSERT(m_pageViewportController);
m_pageViewportController->pageDidRequestScroll(position);
} else {
m_ewkView->setPagePosition(FloatPoint(position));
m_ewkView->scheduleUpdateDisplay();
if (m_page->useFixedLayout()) {
m_ewkView->pageViewportController()->pageDidRequestScroll(position);
return;
}
m_ewkView->setPagePosition(FloatPoint(position));
m_ewkView->scheduleUpdateDisplay();
}

void WebView::didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect)
{
if (m_page->useFixedLayout()) {
ASSERT(m_pageViewportController);
m_pageViewportController->didRenderFrame(contentsSize, coveredRect);
} else
m_ewkView->scheduleUpdateDisplay();
m_ewkView->pageViewportController()->didRenderFrame(contentsSize, coveredRect);
return;
}
m_ewkView->scheduleUpdateDisplay();
}

void WebView::pageTransitionViewportReady()
{
if (m_page->useFixedLayout()) {
ASSERT(m_pageViewportController);
m_pageViewportController->pageTransitionViewportReady();
} else
m_ewkView->scheduleUpdateDisplay();
m_ewkView->pageViewportController()->pageTransitionViewportReady();
return;
}
m_ewkView->scheduleUpdateDisplay();
}

} // namespace WebKit
@@ -40,9 +40,6 @@ class EwkView;

namespace WebKit {

class PageViewportController;
class PageViewportControllerClientEfl;

class WebView : public APIObject, public PageClient {
public:
static const Type APIType = TypeView;
@@ -163,9 +160,6 @@ class WebView : public APIObject, public PageClient {
EwkView* m_ewkView;
RefPtr<WebPageProxy> m_page;
DefaultUndoController m_undoController;
// FIXME: Remove when possible.
OwnPtr<WebKit::PageViewportControllerClientEfl> m_pageViewportControllerClient;
OwnPtr<WebKit::PageViewportController> m_pageViewportController;
};

}

0 comments on commit b66983a

Please sign in to comment.