summaryrefslogtreecommitdiffstats
path: root/lib/web_contents_view_qt.cpp
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2013-07-31 16:07:01 +0200
committerPierre Rossi <pierre.rossi@gmail.com>2013-08-02 11:24:21 +0200
commitd1e168102555e903d41394484f5a8a0c13f1548f (patch)
tree5ba2ed679bbe39793a5def5399fc6366a36671ec /lib/web_contents_view_qt.cpp
parent0161c0aca53be2c73e983c12995104308823e41b (diff)
Don't pass the RWHV to the AdapterClient
As this looks like a layering violation. Instead, rely on WebContentsViewImpl::CreateRenderViewForRenderManager querying the WebContentsView's size before setting it on the RenderWidgetHostView. The WebContentsView now gets the size of the actual view through the Adapter interface. Then, in RenderWidgetHostViewQt, we now forward the resize request to the delegate. Change-Id: Ide679f6d114508cc7c9ffac83daad19d16764a4d Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'lib/web_contents_view_qt.cpp')
-rw-r--r--lib/web_contents_view_qt.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/web_contents_view_qt.cpp b/lib/web_contents_view_qt.cpp
index ba5887541..9d35b622f 100644
--- a/lib/web_contents_view_qt.cpp
+++ b/lib/web_contents_view_qt.cpp
@@ -50,7 +50,8 @@
content::RenderWidgetHostView* WebContentsViewQt::CreateViewForWidget(content::RenderWidgetHost* render_widget_host)
{
RenderWidgetHostViewQt *view = new RenderWidgetHostViewQt(render_widget_host);
- m_viewDelegate = m_client->CreateRenderWidgetHostViewQtDelegate(view);
+ m_viewDelegate = m_client->CreateRenderWidgetHostViewQtDelegate();
+ m_viewDelegate->resetView(view);
view->SetDelegate(m_viewDelegate);
return view;
@@ -64,7 +65,7 @@ void WebContentsViewQt::SetPageTitle(const string16& title)
void WebContentsViewQt::GetContainerBounds(gfx::Rect* out) const
{
- const QRectF r(m_viewDelegate->screenRect());
+ const QRectF r(m_client->viewportRect());
*out = gfx::Rect(r.x(), r.y(), r.width(), r.height());
}