summaryrefslogtreecommitdiffstats
path: root/lib/web_contents_view_qt.cpp
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2013-07-10 16:27:48 +0200
committerPierre Rossi <pierre.rossi@gmail.com>2013-07-31 13:39:50 +0200
commit67d042d04f2b6cbe98f4eba2a50ed0d374165cae (patch)
treeff24cf732fa98750400a29354219ffbd70c84e1c /lib/web_contents_view_qt.cpp
parent519367a98334b658a93ed1ba096dba92858445c7 (diff)
Split out the Widgets and QtQuick integration
This is the first step to making proper Qt Modules out of QtWebEngine. The Widgets integration becomes a proper C++ Qt Module while we make the QtQuick side a QML plugin for now (could probably be promoted if the need arises). Code-wise, this means the introduction of a WebContentsAdapterClient interface that is subclassed by the private implementation of our API classes for delegation of things that are UI specific. Functionality from WebContents and the like is exposed via the WebContentsAdapter. Change-Id: I4ca3395b9fe8502a24e36002cfd5af44067bb6e8 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.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/lib/web_contents_view_qt.cpp b/lib/web_contents_view_qt.cpp
index 2a44da7ab..ba5887541 100644
--- a/lib/web_contents_view_qt.cpp
+++ b/lib/web_contents_view_qt.cpp
@@ -47,14 +47,6 @@
#include "content/browser/renderer_host/render_view_host_impl.h"
-WebContentsViewQtClient::WebContentsViewQtClient()
-// This has to be the first thing we do.
- : context(WebEngineContext::current())
-{
- content::BrowserContext* browser_context = ContentBrowserClientQt::Get()->browser_context();
- webContentsDelegate.reset(new WebContentsDelegateQt(browser_context, NULL, MSG_ROUTING_NONE, gfx::Size()));
-}
-
content::RenderWidgetHostView* WebContentsViewQt::CreateViewForWidget(content::RenderWidgetHost* render_widget_host)
{
RenderWidgetHostViewQt *view = new RenderWidgetHostViewQt(render_widget_host);
@@ -67,14 +59,13 @@ content::RenderWidgetHostView* WebContentsViewQt::CreateViewForWidget(content::R
void WebContentsViewQt::SetPageTitle(const string16& title)
{
QString string = QString::fromUtf16(title.data());
- Q_EMIT m_client->webContentsDelegate->titleChanged(string);
+ m_client->titleChanged(string);
}
void WebContentsViewQt::GetContainerBounds(gfx::Rect* out) const
{
- content::RenderWidgetHostView* rwhv = m_client->webContentsDelegate->web_contents()->GetRenderWidgetHostView();
- if (rwhv)
- *out = rwhv->GetViewBounds();
+ const QRectF r(m_viewDelegate->screenRect());
+ *out = gfx::Rect(r.x(), r.y(), r.width(), r.height());
}
void WebContentsViewQt::Focus()