summaryrefslogtreecommitdiffstats
path: root/src/core/download_manager_delegate_qt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-02-021-2/+5
|\ | | | | | | | | | | | | Conflicts: tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp Change-Id: Ibf03467e398f8dcdb5f950e1a70f3e4e591003db
| * Do not extract download file names from certain url schemesMichael Brüning2021-01-221-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Chromium uses the default download file name if the scheme of a file to download is either about or data, as the file name extraction methods do not seems to work for those. Mimic this behavior in Qt WebEngine as well. Fixes: QTBUG-90355 Change-Id: I14b8c4f64559500d3f231dd26533a5947bf94bc3 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-01-251-0/+3
|\| | | | | | | | | | | Including update to 87-based Change-Id: I36b6054e00de97ab055d0bc800cff08d0408fac6
| * Adaptations for Chromium 85Allan Sandfeld Jensen2021-01-131-0/+3
| | | | | | | | | | Change-Id: I33c1af7c431055d95e0fb540246765cce684de15 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-09-141-19/+24
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty src/core/certificate_error_controller.cpp src/core/certificate_error_controller.h src/core/compositor/compositor.cpp src/core/compositor/compositor.h src/core/compositor/display_gl_output_surface.cpp src/core/content_browser_client_qt.cpp src/core/core_chromium.pri src/core/delegated_frame_host_client_qt.cpp src/core/ozone/gl_share_context_qt.h src/core/ozone/surface_factory_qt.cpp src/core/permission_manager_qt.cpp src/core/render_widget_host_view_qt.cpp src/core/render_widget_host_view_qt.h src/core/web_engine_context.cpp src/core/web_engine_settings.cpp src/core/web_event_factory.cpp tests/auto/widgets/qwebenginedownloadrequest/tst_qwebenginedownloadrequest.cpp Change-Id: Ice14c3c350b139e800c7c7011b7cef1fc7010669
| * Chromium 81-based adaptationsAllan Sandfeld Jensen2020-09-091-19/+24
| | | | | | | | | | Change-Id: Ie422b327025da084bc8038c7a0aadee2db801f29 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Remove obsolete, deprecated api from qwebenginedownloaditemMichal Klocek2020-08-181-14/+2
|/ | | | | | | | | | This patch removes: * path() * type() * DownloadType enum Change-Id: I3e29f9e8ce9e39b015c57cb7005e0290d1496291 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Adaptations for Chromium 80Allan Sandfeld Jensen2020-04-071-24/+4
| | | | | Change-Id: Icaf68648cbc2c13a61fc3b208ff1e64ca36c90b6 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Adaptations for Chromium 79Allan Sandfeld Jensen2020-02-281-4/+2
| | | | | | | | Fixes: QTBUG-80737 Fixes: QTBUG-81556 Fixes: QTBUG-81614 Change-Id: Ie6a69cdbf46d0508bff226f1b8fed28a618e1949 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix 'setDownloadDirectory' for download item on 'SavePage' actionKirill Burtsev2019-11-291-1/+1
| | | | | | | | | | | | | | Chromium's DownloadManager doesn't create its download items before path for saving page is confirmed. So assert inside updateDownloadPath was not correct. Moreover, the name is confusing because it's not really updating anything. Remove it and use ProfileAdapterClient::DownloadInfo timestamp to determine updated filename after directory change. Ammends recent new api for changing download directory 0884fab3b1. Fixes: QTBUG-80372 Change-Id: If9efb52979deb3cf21fc4e12989173c85e04e090 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Add API to change download directory path and file nameTamas Zakor2019-07-051-22/+9
| | | | | | | | | | | | | | | | | | Add functions and property to change the download directory and file name in QWebEngineDownloadItem and QQuickWebEngineDownloadItem and deprecate the path() and setPath(). Regenerating the uniquifying download filename after change the download directory. [ChangeLog][DownloadItem] Add functions and property to change the download directory and file name in QWebEngineDownloadItem and QQuickWebEngineDownloadItem and deprecate the path() and setPath(). Task-number: QTBUG-56978 Change-Id: I6e63da82a187add8bc3206cc80c8bf6865fbdd35 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add API to get the suggested download file nameTamas Zakor2019-05-161-3/+7
| | | | | | | | | [ChangeLog][DownloadItem] Add functions and property to get the suggested download file name. Task-number: QTBUG-56978 Change-Id: I902870c6358271322da613a15ccc11639384e404 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge branch '5.12' into 5.13Allan Sandfeld Jensen2019-04-091-2/+9
|\ | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty src/core/renderer/user_resource_controller.cpp src/core/web_contents_adapter.cpp src/webengine/doc/src/qtwebengine-overview.qdoc Change-Id: I46be9d33b3b65d61dfa099ee72a3509afb9bd6a4
| * Normalize download path on WindowsPeter Varga2019-04-051-1/+1
| | | | | | | | | | | | | | Task-number: QTBUG-74698 Task-number: QTBUG-74251 Change-Id: I4358feb7fb28b226edb24ed10611e797fcd3c326 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Fix timestamp deduplication for WindowsPeter Varga2019-03-281-2/+9
| | | | | | | | | | | | | | | | Based on https://chromium-review.googlesource.com/c/chromium/src/+/1432882 Task-number: QTBUG-74764 Change-Id: I74b4711f5146d2d2261487f13ccac702b9aa969e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Fix incrementing download IDTamas Zakor2019-02-281-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | Adapt DownloadManagerDelegateQt::m_currentId to https://chromium-review.googlesource.com/1144311 Update Chromium: 09516a434b [Backport] Allow DownloadManagerImpl to get InProgressDownloadManager from DownloadManagerService b3edbf2a84 [Backport] Make DownloadManagerImpl to generate download IDs for in-progress DB Task-number: QTBUG-70702 Change-Id: I1224643398a2084fcd5d70d2c04b105ed69c1f3d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Normalize download path on WindowsAllan Sandfeld Jensen2019-03-261-1/+1
| | | | | | | | | | | | Task-number: QTBUG-74698 Change-Id: I3fd4b932b1d4b0ecc844818f87c1824eac1f56e6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Adaptations for Chromium 73Allan Sandfeld Jensen2019-03-231-1/+1
| | | | | | | | | | Change-Id: I565d1e327852110a5abebed3388d7cd6986bef06 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Fix incrementing download IDTamas Zakor2019-02-141-2/+6
| | | | | | | | | | | | | | | | Adapt DownloadManagerDelegateQt::m_currentId to https://chromium-review.googlesource.com/1144311 Change-Id: I74d0165b096d5d02261290a7f84fda420a2b146c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Add API to set default download pathTamas Zakor2019-01-301-1/+1
|/ | | | | | | | | | | | | | | | | | | Add functions and property to set the default download location in QWebEngineProfile and QQuickWebEngineProfile. Also add new test for check uniquifying download filename. Update plugins.qmltypes to 1.9 [ChangeLog][Profile][QtWebEngine][QtWebEngineWidgets] Add functions and property to set the default download location in QWebEngineProfile and QQuickWebEngineProfile. Task-number: QTBUG-66262 Task-number: QTBUG-72176 Change-Id: I7fa93b66c326766b176aec24d453dd75602b91de Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Remove download items internally when API objects are deletedAllan Sandfeld Jensen2019-01-211-10/+20
| | | | | | | | | | We were never removing internal download item. [ChangeLog][Behavioral Changes] Deleting a download item will now also cancel it if it is still in progress. Change-Id: I2fab497d7acf7ca6ca17f4a61e106b1c18bfb333 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Fix uniquifying download filenameTamas Zakor2019-01-021-8/+8
| | | | | | | | | | | | | The QFileInfo::baseName() can’t be used to split the filename when it contains a dot what is not for extension. Moreover, use timestamps after 100 numerically deduplicated filenames as chrome do: https://chromium-review.googlesource.com/c/1278137 Task-number: QTBUG-66262 Change-Id: Ice548ba2824bd43cf7ad00509b598853087274af Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fallback to Latin-1 if ASCII and UTF-8 doesn't workAllan Sandfeld Jensen2018-09-051-1/+2
| | | | | | | | | | Latin-1 is a standard fallback for HTTP headers, but no one that HTTPContentDisposition::Parse considers by default. Task-number: QTBUG-70288 Change-Id: Ife36fffe31da5492cde49a4d447cfc42b3f64b95 Reviewed-by: Zakor Tamas <ztamas@inf.u-szeged.hu> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Add QWebEngineDownloadItem page/view accessorAllan Sandfeld Jensen2018-08-021-3/+20
| | | | | | | | | | To be able to determine where a download was triggered. [ChangeLog][DownloadItem] Added a page/view accessor to tell were the download was triggered. Change-Id: I21843a545a3e0eb66f5e5fa8a50e77564f2118a7 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Rename BrowserAdapterClient to ProfileAdapterClientMichal Klocek2018-07-091-21/+21
| | | | | Change-Id: I1f8c0d2e59c2565b24c8c636553f1b70bcd31774 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Rename BrowserContextAdapter to ProfileAdapterMichal Klocek2018-07-091-10/+10
| | | | | | | | | Follow change of BrowserContextQt to ProfileQt. Fix wrong naming usage of browserContext instead of browserContextAdapter. Change-Id: I75fdac685d9bffd44f0144921d3e87305d6d44c9 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Finalize change from BrowserContext to ProfileMichal Klocek2018-07-061-3/+3
| | | | | | | | | | Changes 6c319ce and af313cb splited BrowserContextQt into ProfileQt and ProfileIODataQt. Finalize the change and rename leftover browserContext references to follow the initial change. Change-Id: I845142b1edb67ec4b94439be1e6cfc841dd3f55c Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Adaptations for Chromium 66Allan Sandfeld Jensen2018-06-261-19/+19
| | | | | Change-Id: Iee88721a50036d4ef85a23dd1708d4fb84218708 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Use range-based for instead of Q_FOREACHJüri Valdmann2018-06-061-3/+3
| | | | | Change-Id: Ibf016b795ff98fddfa29fb5dc63924a2d2159d71 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Rename BrowserContextQt to ProfileQtMichal Klocek2018-05-251-3/+3
| | | | | | | | | | | | Following commits are going to introduce ProfileIODataQt and to keep things self documented just rename the class so it reflects Chromium one. Fix minor style issues in profile_qt.h Presort include headers as requested on review. Change-Id: If58f5aec8ac64cfaf30642195838a77497b75244 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Implement IsMostRecentDownloadItemAtFilePath callMichal Klocek2018-03-181-0/+20
| | | | | | | | | Implement IsMostRecentDownloadItemAtFilePath for download_manager_delegate_qt. This is required for CVE-2018-6033. Change-Id: I979b77042facf7d3acaef5eda7a6e842f715a1ef Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fixup merge of downloadType from 5.10.1Allan Sandfeld Jensen2018-02-211-3/+16
| | | | | | | | | | | | | In 5.11 we deprecated downloadType and at the same time ripped out most of the faulty logic. Later we partially fixed the logic in 5.10.1, but kept the 5.11 version during the merge. This restores the improved logic from 5.10.1, while keeping the property deprecated since it is still misleading at times. Change-Id: I12ee09a2b212506f7ba1a336c9c2e88aa3b1de24 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Deprecate download typeJüri Valdmann2018-01-021-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes the download type property from QtWebEngineCore and replaces it with a simple boolean 'isSavePageDownload'. On the public API boundary the type property is reimplemented via this boolean and documented as obsolete. Rationale being that 1. This feature seems to lack practical use cases, other than perhaps distinguishing save-page downloads from normal file downloads, which can be done in a much simpler way. 2. This feature does not work as documented and never has. So far nobody has complained, hinting again at a lack of practical use cases. 3. In order to fix it we would need to maintain patches on top of Chromium and Blink (we would, for example, need to propagate the DownloadAttribute type from Blink to Chromium to WebEngine). [ChangeLog][Deprecation Notice] (QWebEngine)DownloadItem::type() is deprecated and replaced with the newly introduced isSavePageDownload() property. Task-number: QTBUG-62640 Change-Id: Icf4e1e5a635028986df7eab979f4c0527902ff0c Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Adaptations for Chromium 59Allan Sandfeld Jensen2017-09-111-4/+7
| | | | | Change-Id: I472053e316bfa782d0a6fb8903f4901be12247ae Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Implement pause and resume action in Download ItemsAllan Sandfeld Jensen2017-06-231-0/+22
| | | | | | | | | Adds the ability to pause downloads, and resume paused or interrupted downloads. Task-number: QTBUG-56840 Change-Id: I018bd30c3a772a36d48e4154d94f69cb8d8319e4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Merge remote-tracking branch 'origin/5.8' into devAllan Sandfeld Jensen2017-01-181-1/+1
|\ | | | | | | Change-Id: If16bfc6f0fbfd0040e13a8a3cbaa113fda10f387
| * QWebEngineDownloadItem::path() should not be percentage encodedAllan Sandfeld Jensen2017-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the name of the download item is derived from the URL, we currently end up reporting a partially percentage encoded name. This is problematic if our users try to undo the the percentage encoding and opens them out to download-folder escaping files that can install hooks in the user's home directory. [ChangeLog][DownloadItem] (QWebEngine)DownloadItem::path() was previously incorrectly returning percentage encoded file-names when the suggested path was based on URL. This has been corrected. Note percentage decoding the path generally before is not just incorrect when the path is not based on URL, but also dangerous as it can lead to downloads that escape the download folder. Task-number: QTBUG-58155 Change-Id: Ie23a4ff5d4e4c353df72e617bb2b00e1935cd6c1 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Add methods for textual description of DownloadInterruptReasonViktor Engelmann2017-01-121-38/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A method was added to get a textual description of a Q(Quick)WebEngineDownloadItem::DownloadInterruptReason. Basically returns the same description from the QDoc entry, but shortened where that was to long. Also moved the ASSERT_ENUMS_MATCHes from download_manager_delegate_qt.cpp to the newly created browser_context_adapter_client.cpp. Task-number: QTBUG-56839 Change-Id: I17c68987b7f12fcaeb71fd27f7ebb35c0ac87bac Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Add DownloadInterruptReason to Q(Quick)WebEngineDownloadItemViktor Engelmann2016-12-071-3/+34
|/ | | | | | | | | | | | | | Add enum DownloadInterruptReason to BrowserContextAdapterClient, QWebEngineDownloadItem and QQuickWebEngineDownloadItem. Also add corresponding attributes to BrowserContextAdapterClient::DownloadItemInfo, QWebEngineDownloadItemPrivate and QQuickWebEngineDownloadItemPrivate as well as getters in QWebEngineDownloadItem and QQuickWebEngineDownloadItem and interruptReasonChanged signals. Task-number: QTBUG-56839 Change-Id: I937c14ba0b0884b14ae18ba297024b76dde62605 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add a DownloadType enum property to WebEngineDownloadItemAdam Kallai2016-06-221-3/+12
| | | | | | | | | | | With this property the user gets the requested download's type. In other words, the user can identify the download where it comes from based on the type. Update public API list as well. Change-Id: I2b066d7eb4df1134266ad67ade0066e3bcc2b454 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Introduce QWebEnginePage::saveJoerg Bornemann2016-06-161-8/+27
| | | | | | | | | 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>
* Unify license header usage.Jani Heikkinen2016-02-011-11/+14
| | | | | | | | | Update files using old header.LGPL3 to use header.LGPL Update files using old header.FLD to use new header.FDL Update files using old header.BSD to use new header.BSD Change-Id: I36a67aaa8c3ca6c7946308defc9c03c3571a7d23 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* Merge branch '5.6' into devAllan Sandfeld Jensen2016-01-121-10/+19
|\ | | | | | | Change-Id: I4272eb59cac08c69eaa58dd4d94debf1b8c5cf78
| * Make the MIME-type of downloads availableAllan Sandfeld Jensen2015-12-071-10/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | An application currently have to rely on suggested filename only to guess the type of a download. This is often insufficient when the suffix is misleading or missing. This patch adds the mimetype to the reported metadata and also adds a mimetype appropriate suffix to suggested filenames. Task-number: QTBUG-48206 Change-Id: I4c70f076d6eb5ae820fd6b7f568515eeb7c18df5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Add web action for saving the current web pageJoerg Bornemann2015-12-111-0/+59
|/ | | | | | | | Add the possibility to save web pages as single HTML file, complete HTML (with resource directory) or MHTML archive. Change-Id: Ic7e7cfda9432f3534c13350a6369d79bb17fd8b3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* Parse suggested filename from content-dispositionAllan Sandfeld Jensen2015-09-301-0/+4
| | | | | | | | | Chromium hasn't parsed content-disposition by the time we get the download item, so we need to call the parsing manually. Change-Id: I105d0c6904dd764b368cb774e377a6028c082513 Task-number: QTBUG-48206 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Clean up global profiles and ownershipAllan Sandfeld Jensen2015-03-121-4/+14
| | | | | | | | | | | | | This patch removes the unused global off-the-record browser-contexts and changes all browser-contexts to be ref-counted by an API level profile. The API default profiles are now owned by a global QObject and are deleted on exit. Change-Id: Id7c9eafa24829118105f58b66663a6348216823d Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com> Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Add namespace to internal QtWebEngine APIAllan Sandfeld Jensen2015-03-021-0/+4
| | | | | | | | Adds the QtWebEngineCore namespace to all internal core API. This ensures we don't export any internal symbols in the global namespace. Change-Id: I26af888ea7c6c4c4d0f04c24a377c1a9d3c92751 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-161-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: Ieb6bac7a1be5c25eb7cb917495b58b6a870ca6d4 Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
* Reverse the logic for download cancellationAndras Becsi2015-02-061-6/+5
| | | | | | | | | Since we require downloads to be explicitly accepted we should have 'accepted' as a member in the download info instead of 'cancelled'. Change-Id: Ia8ff4a4b29f3c8631f4cb1c410ece5f11d9cdc93 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>