summaryrefslogtreecommitdiff
path: root/lib/qwebcontentsview.cpp
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2013-06-12 09:57:11 +0200
committerPierre Rossi <pierre.rossi@digia.com>2013-06-12 16:08:45 +0200
commit0f0c301265d0acd2ea15769b0930eb4054e54a3d (patch)
tree7b75c7b87f6f89374746b8e2b8973b134da84df4 /lib/qwebcontentsview.cpp
parent6c455978062b8e39e7a8815c95b39c0aefc8da74 (diff)
downloadqtwebengine-0f0c301265d0acd2ea15769b0930eb4054e54a3d.tar.gz
Start simplifying WebContentsDelegateQt
Mostly removing duplicated code so far.
Diffstat (limited to 'lib/qwebcontentsview.cpp')
-rw-r--r--lib/qwebcontentsview.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/qwebcontentsview.cpp b/lib/qwebcontentsview.cpp
index 1f23fb0d1..35eed1823 100644
--- a/lib/qwebcontentsview.cpp
+++ b/lib/qwebcontentsview.cpp
@@ -51,8 +51,10 @@
#include "browser_context_qt.h"
#include "content_browser_client_qt.h"
#include "web_contents_delegate_qt.h"
+#include "web_contents_view_qt.h"
#include "web_engine_context.h"
+#include <QVBoxLayout>
#include <QWidget>
#include <QUrl>
@@ -70,7 +72,12 @@ QWebContentsView::QWebContentsView()
d->context = WebEngineContext::current();
content::BrowserContext* browser_context = static_cast<ContentBrowserClientQt*>(content::GetContentClient()->browser())->browser_context();
- d->webContentsDelegate.reset(WebContentsDelegateQt::CreateNewWindow(browser_context, GURL(std::string("http://qt-project.org/")), NULL, MSG_ROUTING_NONE, gfx::Size(), this));
+ d->webContentsDelegate.reset(WebContentsDelegateQt::CreateNewWindow(browser_context, GURL(std::string("http://qt-project.org/")), NULL, MSG_ROUTING_NONE, gfx::Size()));
+ QVBoxLayout *layout = new QVBoxLayout;
+ setLayout(layout);
+
+ WebContentsViewQt* content_view = static_cast<WebContentsViewQt*>(d->webContentsDelegate->web_contents()->GetView());
+ layout->addLayout(content_view->windowContainer()->widget());
}
QWebContentsView::~QWebContentsView()