diff options
author | Zeno Albisser <zeno.albisser@digia.com> | 2013-06-06 17:29:45 +0200 |
---|---|---|
committer | Zeno Albisser <zeno.albisser@digia.com> | 2013-06-10 15:01:02 +0200 |
commit | 83a2bc6d446387d25fd10164e87627c9d49878eb (patch) | |
tree | 164f0c7cc5b4d8cb195afbf388f628e62eaa1b91 /lib/qwebcontentsview.cpp | |
parent | 54ed434fe3ab34ca007bc58111d19196c686ecc0 (diff) | |
download | qtwebengine-83a2bc6d446387d25fd10164e87627c9d49878eb.tar.gz |
Replace Shell with WebContentsDelegateQt.
Diffstat (limited to 'lib/qwebcontentsview.cpp')
-rw-r--r-- | lib/qwebcontentsview.cpp | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/lib/qwebcontentsview.cpp b/lib/qwebcontentsview.cpp index 0d538af82..c30973a48 100644 --- a/lib/qwebcontentsview.cpp +++ b/lib/qwebcontentsview.cpp @@ -50,6 +50,7 @@ #include "content/shell/shell_browser_context.h" #include "content_browser_client_qt.h" +#include "web_contents_delegate_qt.h" #include <QWidget> #include <QUrl> @@ -61,7 +62,7 @@ QWebContentsView* gWidgetView = 0; class QWebContentsViewPrivate { public: - scoped_ptr<content::Shell> shell; + scoped_ptr<WebContentsDelegateQt> webContentsDelegate; }; QWebContentsView::QWebContentsView() @@ -70,14 +71,9 @@ QWebContentsView::QWebContentsView() // Cheap hack to allow getting signals from shell_qt.cpp. Q_ASSERT(!content::gWidgetView); - content::gWidgetView = this; content::BrowserContext* browser_context = static_cast<ContentBrowserClientQt*>(content::GetContentClient()->browser())->browser_context(); - d->shell.reset(content::Shell::CreateNewWindow(browser_context, - GURL(std::string("http://qt-project.org/")), - NULL, - MSG_ROUTING_NONE, - gfx::Size())); + d->webContentsDelegate.reset(WebContentsDelegateQt::CreateNewWindow(browser_context, GURL(std::string("http://qt-project.org/")), NULL, MSG_ROUTING_NONE, gfx::Size(), this)); } QWebContentsView::~QWebContentsView() @@ -93,24 +89,24 @@ void QWebContentsView::load(const QUrl& url) content::NavigationController::LoadURLParams params(gurl); params.transition_type = content::PageTransitionFromInt(content::PAGE_TRANSITION_TYPED | content::PAGE_TRANSITION_FROM_ADDRESS_BAR); - d->shell->web_contents()->GetController().LoadURLWithParams(params); - d->shell->web_contents()->GetView()->Focus(); + d->webContentsDelegate->web_contents()->GetController().LoadURLWithParams(params); + d->webContentsDelegate->web_contents()->GetView()->Focus(); } void QWebContentsView::back() { - d->shell->web_contents()->GetController().GoToOffset(-1); - d->shell->web_contents()->GetView()->Focus(); + d->webContentsDelegate->web_contents()->GetController().GoToOffset(-1); + d->webContentsDelegate->web_contents()->GetView()->Focus(); } void QWebContentsView::forward() { - d->shell->web_contents()->GetController().GoToOffset(1); - d->shell->web_contents()->GetView()->Focus(); + d->webContentsDelegate->web_contents()->GetController().GoToOffset(1); + d->webContentsDelegate->web_contents()->GetView()->Focus(); } void QWebContentsView::reload() { - d->shell->web_contents()->GetController().Reload(false); - d->shell->web_contents()->GetView()->Focus(); + d->webContentsDelegate->web_contents()->GetController().Reload(false); + d->webContentsDelegate->web_contents()->GetView()->Focus(); } |