diff options
author | Joerg Bornemann <joerg.bornemann@theqtcompany.com> | 2016-03-31 17:36:22 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2016-06-16 15:53:32 +0000 |
commit | 3398abfc1b5b789d11592aada0b5860e36a50041 (patch) | |
tree | 0c18602e09e9f3a250d8de6fa8618e2895aa07dc /src/core/web_contents_delegate_qt.h | |
parent | 939d104cc5a8208a0bef94ca14889ccd584a3526 (diff) |
Introduce QWebEnginePage::save
Add the convenience method QWebEnginePage::save for saving pages without
the need to explicitly handle download requests.
Task-number: QTBUG-51798
Change-Id: I8910ce8cb7c9370d72f2b209c4d2de07c614f6d6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_delegate_qt.h')
-rw-r--r-- | src/core/web_contents_delegate_qt.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h index 73ad5a9ac..b60f31ac3 100644 --- a/src/core/web_contents_delegate_qt.h +++ b/src/core/web_contents_delegate_qt.h @@ -69,6 +69,23 @@ namespace QtWebEngineCore { class WebContentsAdapterClient; +class SavePageInfo +{ +public: + SavePageInfo() + : requestedFormat(-1) + { + } + + SavePageInfo(const QString &filePath, int format) + : requestedFilePath(filePath), requestedFormat(format) + { + } + + QString requestedFilePath; + int requestedFormat; +}; + class WebContentsDelegateQt : public content::WebContentsDelegate , public content::WebContentsObserver { @@ -125,6 +142,9 @@ public: void launchExternalURL(const QUrl &url, ui::PageTransition page_transition, bool is_main_frame); FaviconManager *faviconManager(); + void setSavePageInfo(const SavePageInfo &spi) { m_savePageInfo = spi; } + const SavePageInfo &savePageInfo() { return m_savePageInfo; } + private: WebContentsAdapter *createWindow(content::WebContents *new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture); @@ -133,6 +153,7 @@ private: int m_lastReceivedFindReply; QVector<int64_t> m_loadingErrorFrameList; QScopedPointer<FaviconManager> m_faviconManager; + SavePageInfo m_savePageInfo; }; } // namespace QtWebEngineCore |