From bbeaf3278de08da00f56aba3511951aaf6a8d233 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Mon, 17 Jun 2013 18:58:06 +0200 Subject: Allow the API class to provide the page widget rendering implementation. - Rename NativeViewQt to RenderWidgetHostViewQtDelegate to keep the context obvious. - Use an interface to handle the parenting instead of the NativeViewContainerQt mechanism that was needed with the Shell. --- lib/render_widget_host_view_qt_delegate_widget.h | 41 ++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 lib/render_widget_host_view_qt_delegate_widget.h (limited to 'lib/render_widget_host_view_qt_delegate_widget.h') diff --git a/lib/render_widget_host_view_qt_delegate_widget.h b/lib/render_widget_host_view_qt_delegate_widget.h new file mode 100644 index 000000000..9087ba017 --- /dev/null +++ b/lib/render_widget_host_view_qt_delegate_widget.h @@ -0,0 +1,41 @@ +#ifndef RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_WIDGET_H +#define RENDER_WIDGET_HOST_VIEW_QT_DELEGATE_WIDGET_H + +#include "shared/render_widget_host_view_qt_delegate.h" + +#include + +class BackingStoreQt; +class QWindow; + +namespace content { + class RenderWidgetHostViewQt; +} + +class RenderWidgetHostViewQtDelegateWidget : public QWidget, public RenderWidgetHostViewQtDelegate +{ +public: + RenderWidgetHostViewQtDelegateWidget(content::RenderWidgetHostViewQt* view, QWidget *parent = 0); + + virtual void setBackingStore(BackingStoreQt* backingStore); + virtual QRectF screenRect() const; + virtual void show(); + virtual void hide(); + virtual bool isVisible() const; + virtual QWindow* window() const; + virtual void update(const QRect& rect = QRect()); + + QPainter* painter(); + +protected: + void paintEvent(QPaintEvent * event); + bool event(QEvent *event); + void resizeEvent(QResizeEvent *resizeEvent); + +private: + BackingStoreQt* m_backingStore; + QPainter* m_painter; + content::RenderWidgetHostViewQt *m_view; +}; + +#endif -- cgit v1.2.3