diff options
author | Pierre Rossi <pierre.rossi@theqtcompany.com> | 2015-01-22 15:28:31 +0100 |
---|---|---|
committer | Andras Becsi <andras.becsi@theqtcompany.com> | 2015-02-05 17:26:46 +0000 |
commit | 3b997310ff9299949481eeb68541a5a4752b4aaf (patch) | |
tree | f2927c7176ca30ea54a53c316576077c597d93e2 /src/core | |
parent | 0cf3235924e7ea95c5804c807a9ef0e91678c49d (diff) |
Simplify access to WebContents from adapter.
Change-Id: I42cc8b28dd9aef9d23b83a43a60d8d59c16f4b1d
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 6 | ||||
-rw-r--r-- | src/core/web_contents_adapter.h | 4 | ||||
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index ed8422b6e..83ad1efe8 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -819,3 +819,9 @@ void WebContentsAdapter::filesSelectedInChooser(const QStringList &fileList, Web files = listRecursively(QDir(fileList.first())); rvh->FilesSelectedInChooser(toVector<content::FileChooserFileInfo>(files), static_cast<content::FileChooserParams::Mode>(mode)); } + +content::WebContents *WebContentsAdapter::webContents() const +{ + Q_D(const WebContentsAdapter); + return d->webContents.get(); +} diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h index 33d7e3cd9..3c4ad9970 100644 --- a/src/core/web_contents_adapter.h +++ b/src/core/web_contents_adapter.h @@ -116,11 +116,13 @@ public: BrowserContextQt* browserContext(); BrowserContextAdapter* browserContextAdapter(); + // meant to be used within WebEngineCore only + content::WebContents *webContents() const; + private: Q_DISABLE_COPY(WebContentsAdapter); Q_DECLARE_PRIVATE(WebContentsAdapter); QScopedPointer<WebContentsAdapterPrivate> d_ptr; - friend class WebContentsDelegateQt; }; #endif // WEB_CONTENTS_ADAPTER_H diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 50aafd55e..03e03acc3 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -85,7 +85,7 @@ content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents if (params.disposition != CURRENT_TAB) { WebContentsAdapter *targetAdapter = createWindow(0, params.disposition, gfx::Rect(), params.user_gesture); if (targetAdapter) - target = targetAdapter->d_func()->webContents.get(); + target = targetAdapter->webContents(); } content::NavigationController::LoadURLParams load_url_params(params.url); |