diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/render_widget_host_view_qt.cpp | 31 | ||||
-rw-r--r-- | src/core/render_widget_host_view_qt.h | 5 | ||||
-rw-r--r-- | src/core/render_widget_host_view_qt_delegate.h | 3 | ||||
-rw-r--r-- | src/core/web_contents_adapter_client.h | 1 |
4 files changed, 22 insertions, 18 deletions
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp index 9365020a0..d0c8f1482 100644 --- a/src/core/render_widget_host_view_qt.cpp +++ b/src/core/render_widget_host_view_qt.cpp @@ -216,9 +216,7 @@ void RenderWidgetHostViewQt::InitAsChild(gfx::NativeView) void RenderWidgetHostViewQt::InitAsPopup(content::RenderWidgetHostView*, const gfx::Rect& rect) { - QRect screenRect = toQt(rect); - screenRect.moveTo(m_adapterClient->mapToGlobal(screenRect.topLeft())); - m_delegate->initAsPopup(screenRect); + m_delegate->initAsPopup(toQt(rect)); } void RenderWidgetHostViewQt::InitAsFullscreen(content::RenderWidgetHostView*) @@ -238,12 +236,12 @@ void RenderWidgetHostViewQt::SetSize(const gfx::Size& size) m_delegate->resize(width,height); } -void RenderWidgetHostViewQt::SetBounds(const gfx::Rect& rect) +void RenderWidgetHostViewQt::SetBounds(const gfx::Rect& screenRect) { // This is called when webkit has sent us a Move message. - if (IsPopup()) - m_delegate->move(m_adapterClient->mapToGlobal(toQt(rect.origin()))); - SetSize(rect.size()); + if (IsPopup()) + m_delegate->move(toQt(screenRect.origin())); + SetSize(screenRect.size()); } gfx::Size RenderWidgetHostViewQt::GetPhysicalBackingSize() const @@ -659,7 +657,18 @@ QSGNode *RenderWidgetHostViewQt::updatePaintNode(QSGNode *oldNode) void RenderWidgetHostViewQt::notifyResize() { - GetRenderWidgetHost()->WasResized(); + m_host->WasResized(); +} + +void RenderWidgetHostViewQt::windowBoundsChanged() +{ + m_host->SendScreenRects(); +} + +void RenderWidgetHostViewQt::windowChanged() +{ + if (m_delegate->window()) + m_host->NotifyScreenInfoChanged(); } bool RenderWidgetHostViewQt::forwardEvent(QEvent *event) @@ -729,12 +738,6 @@ QVariant RenderWidgetHostViewQt::inputMethodQuery(Qt::InputMethodQuery query) co } } -void RenderWidgetHostViewQt::windowChanged() -{ - if (m_delegate->window()) - m_host->NotifyScreenInfoChanged(); -} - void RenderWidgetHostViewQt::ProcessAckedTouchEvent(const content::TouchEventWithLatencyInfo &touch, content::InputEventAckState ack_result) { Q_UNUSED(touch); const bool eventConsumed = ack_result == content::INPUT_EVENT_ACK_STATE_CONSUMED; diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h index acb1948a8..90a6ef87c 100644 --- a/src/core/render_widget_host_view_qt.h +++ b/src/core/render_widget_host_view_qt.h @@ -109,7 +109,7 @@ public: virtual void InitAsFullscreen(content::RenderWidgetHostView*) Q_DECL_OVERRIDE; virtual content::RenderWidgetHost* GetRenderWidgetHost() const Q_DECL_OVERRIDE; virtual void SetSize(const gfx::Size& size) Q_DECL_OVERRIDE; - virtual void SetBounds(const gfx::Rect& rect) Q_DECL_OVERRIDE; + virtual void SetBounds(const gfx::Rect&) Q_DECL_OVERRIDE; virtual gfx::Size GetPhysicalBackingSize() const Q_DECL_OVERRIDE; virtual gfx::NativeView GetNativeView() const Q_DECL_OVERRIDE; virtual gfx::NativeViewId GetNativeViewId() const Q_DECL_OVERRIDE; @@ -161,9 +161,10 @@ public: // Overridden from RenderWidgetHostViewQtDelegateClient. virtual QSGNode *updatePaintNode(QSGNode *) Q_DECL_OVERRIDE; virtual void notifyResize() Q_DECL_OVERRIDE; + virtual void windowBoundsChanged() Q_DECL_OVERRIDE; + virtual void windowChanged() Q_DECL_OVERRIDE; virtual bool forwardEvent(QEvent *) Q_DECL_OVERRIDE; virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE; - virtual void windowChanged() Q_DECL_OVERRIDE; void handleMouseEvent(QMouseEvent*); void handleKeyEvent(QKeyEvent*); diff --git a/src/core/render_widget_host_view_qt_delegate.h b/src/core/render_widget_host_view_qt_delegate.h index d83f14235..d636e1d37 100644 --- a/src/core/render_widget_host_view_qt_delegate.h +++ b/src/core/render_widget_host_view_qt_delegate.h @@ -64,9 +64,10 @@ public: virtual ~RenderWidgetHostViewQtDelegateClient() { } virtual QSGNode *updatePaintNode(QSGNode *) = 0; virtual void notifyResize() = 0; + virtual void windowBoundsChanged() = 0; + virtual void windowChanged() = 0; virtual bool forwardEvent(QEvent *) = 0; virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const = 0; - virtual void windowChanged() = 0; }; class QWEBENGINE_EXPORT RenderWidgetHostViewQtDelegate { diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h index e0ff25124..d4f3f6e0b 100644 --- a/src/core/web_contents_adapter_client.h +++ b/src/core/web_contents_adapter_client.h @@ -150,7 +150,6 @@ public: virtual void didUpdateTargetURL(const QUrl&) = 0; virtual void selectionChanged() = 0; virtual QRectF viewportRect() const = 0; - virtual QPoint mapToGlobal(const QPoint &posInView) const = 0; virtual qreal dpiScale() const = 0; virtual void loadStarted(const QUrl &provisionalUrl) = 0; virtual void loadCommitted() = 0; |