summaryrefslogtreecommitdiffstats
path: root/lib/render_widget_host_view_qt_delegate.h
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-10-31 17:06:30 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-11-06 17:34:20 +0100
commitfb62607e950ac711f7366b378d8d5f952d4fd1b3 (patch)
tree5ceb5adaee848f63ec9f27188068e496fb099b8e /lib/render_widget_host_view_qt_delegate.h
parentfbf3e79512358a3eb1e6589b10ac01917b2e94d0 (diff)
Make RenderWidgetHostViewQtDelegate a pure interface.
RenderWidgetHostViewQtDelegate acts as a bidirectional interface to avoid exporting Chromium symbols outside of the core dynamic library. The problem is that, other than this, from the top layer point of view, its responsibilities are the same as RenderWidgetHostViewQt, and it would be better not to split its logic without properly defined responsibilities. Using it as a base class and interfacing through its protected methods is also cumbersome and make the destination of calls on the upper layer difficult to discern. Use instead a dual pure interface mechanism like WebContentsAdapter and pass the callback client interface directly in WebContentsAdapterClient::CreateRenderWidgetHostViewQtDelegate. This allows RenderWidgetHostViewQtDelegate to be solely what it should be, an interface. Change-Id: I4e55439ae7f9539cc9e360f0756fbf391405f3b7 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'lib/render_widget_host_view_qt_delegate.h')
-rw-r--r--lib/render_widget_host_view_qt_delegate.h35
1 files changed, 12 insertions, 23 deletions
diff --git a/lib/render_widget_host_view_qt_delegate.h b/lib/render_widget_host_view_qt_delegate.h
index 3486e3f8d..2f1401b6d 100644
--- a/lib/render_widget_host_view_qt_delegate.h
+++ b/lib/render_widget_host_view_qt_delegate.h
@@ -45,11 +45,8 @@
#include "qtwebengineglobal.h"
#include <QRect>
-#include <QScopedPointer>
#include <QtGui/qwindowdefs.h>
-class BackingStoreQt;
-
QT_BEGIN_NAMESPACE
class QCursor;
class QEvent;
@@ -60,13 +57,22 @@ class QVariant;
class QWindow;
QT_END_NAMESPACE
-class RenderWidgetHostViewQt;
class WebContentsAdapterClient;
-class QWEBENGINE_EXPORT RenderWidgetHostViewQtDelegate {
+class QWEBENGINE_EXPORT RenderWidgetHostViewQtDelegateClient {
+public:
+ virtual ~RenderWidgetHostViewQtDelegateClient() { }
+ virtual void paint(QPainter *, const QRectF& boundingRect) = 0;
+ virtual QSGNode *updatePaintNode(QSGNode *, QQuickWindow *) = 0;
+ virtual void fetchBackingStore() = 0;
+ virtual void notifyResize() = 0;
+ virtual bool forwardEvent(QEvent *) = 0;
+ virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const = 0;
+};
+class QWEBENGINE_EXPORT RenderWidgetHostViewQtDelegate {
public:
- virtual ~RenderWidgetHostViewQtDelegate();
+ virtual ~RenderWidgetHostViewQtDelegate() { }
virtual void initAsChild(WebContentsAdapterClient*) = 0;
virtual void initAsPopup(const QRect&) = 0;
virtual QRectF screenRect() const = 0;
@@ -81,23 +87,6 @@ public:
virtual void updateCursor(const QCursor &) = 0;
virtual void resize(int width, int height) = 0;
virtual void inputMethodStateChanged(bool editorVisible) = 0;
-
-protected:
- RenderWidgetHostViewQtDelegate();
- void paint(QPainter*, const QRectF& boundingRect);
-#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
- QSGNode *updatePaintNode(QSGNode *, QQuickWindow *);
-#endif
- void fetchBackingStore();
- void notifyResize();
- bool forwardEvent(QEvent*);
- QVariant forwardInputMethodQuery(Qt::InputMethodQuery query) const;
-
-private:
- void setView(RenderWidgetHostViewQt*);
- RenderWidgetHostViewQt *m_view;
- BackingStoreQt *m_backingStore;
- friend class RenderWidgetHostViewQt;
};
#endif // RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_H