summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix recovery after sub-process crashAllan Sandfeld Jensen2022-08-111-0/+11
| | | | | | | | | We no longer get RenderViewChanged signal but only a RenderViewReady signal after a crash. Pick-to: 6.4 Change-Id: Ib14cb3092e46e699d55bc252c9dddca524f6b8b7 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Adaptations for Chromium 102Allan Sandfeld Jensen2022-08-041-4/+4
| | | | | | Pick-to: 6.4 Change-Id: I7ef0ad616f2ea0fae482253335e95998aa2d360e Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Various clean-upsPeter Varga2022-06-241-2/+5
| | | | | | Pick-to: 6.4 Change-Id: I53e04a247a25149d9f29135484c0528c706de7d8 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Use SPDX license identifiersLucie Gérard2022-06-221-38/+2
| | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. License files are organized under LICENSES directory. Pick-to: 6.4 Task-number: QTBUG-67283 Change-Id: I869ffda1080e283f231eb0dc4477b260f2054d99 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Switch from QT_NO macros to feature checksAllan Sandfeld Jensen2022-06-101-1/+1
| | | | | | | | | | | This is safer by ensuring we are checking for a feature that is defined. For some reason, the openssl feature is a private feature, so we need to include the private header to access it. Pick-to: 6.4 Change-Id: Idf7f3baba33e5188f206f5be1b8a0bfd75e79d03 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Create a RWHV delegate in coreAllan Sandfeld Jensen2022-06-091-2/+2
| | | | | | | | | | This is adapting the Quick code for shared use with widgets, and allows us to use it from QWebEnginePage. Pick-to: 6.4 Fixes: QTBUG-96377 Change-Id: I3f09c1a949eff86d80fbe6c513dc66e3f9f2f611 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Refactor custom handlersAllan Sandfeld Jensen2022-05-151-2/+3
| | | | | | | | Reimplement the chrome specific classes, as we use very little of them, and move everything to a subdir. Change-Id: I93873399b1bea46c08ed171b7dc75ad252f20108 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Keep page's zoom level on loading new urlsKirill Burtsev2022-05-151-1/+4
| | | | | | | | | | | | Ammends d236c5a8a3. Zoom level was set as a temporal one, which is invalidated each time when a renderer process or widget are changed (on new navigation, for example), so it needs to be reapplied. Pick-to: 6.3 6.2 5.15 Fixes: QTBUG-101030 Change-Id: Iecff9686fbe2b79e99b46f67cab92f66127be085 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Introduce http status code domain for loading infoKirill Burtsev2022-04-181-2/+4
| | | | | | | | | | | | | | | | Fix inconsistency in reporting load info error category for http status codes, which across versions was reported either as internal error category or just no error domain. Add new separate domain for http status codes. [ChangeLog][QWebEngineLoadingInfo] Added HttpStatusCodeDomain for http status code range of errors Fixes: QTBUG-94963 Change-Id: I9fd496248c6fa33c424d758e9a0be99758aaf061 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Benjamin Terrier <b.terrier@gmail.com> Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Resolve status code for http response with failureKirill Burtsev2022-04-071-12/+8
| | | | | | | | | | | | | | All non-default https status codes are hidden under net::ERR_HTTP_RESPONSE_CODE_FAILURE error of network stack. Handle successful load case and set the real http status code for error. Also set localized load error description only for http codes. Pick-to: 6.2 6.3 Fixes: QTBUG-46860 Fixes: QTBUG-61100 Task-number: QTBUG-94963 Change-Id: I81e083441d1814fb530f39ea3da1c4ef52b7da59 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Adaptations for Chrome 98Allan Sandfeld Jensen2022-03-291-36/+18
| | | | | Change-Id: I607604f85a111a69da77ca949dddf3399b9721b3 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Adaptations for Chrome 96Allan Sandfeld Jensen2022-03-291-1/+1
| | | | | Change-Id: I40039658762b8788a0be57bd186efab71f3e4448 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Use IsSameDocument() rather than IsLoadingToDifferentDocument()Benjamin Terrier2022-01-271-1/+1
| | | | | | | | | | | | | For certain types of redirect navigations (for example, with a non-default useragent set) 'IsLoadingToDifferentDocument()' can be unexpectedly false. In such cases 'navigation_handle->IsSameDocument()' also returns false. Fixes: QTBUG-94924 Pick-to: 6.3 6.2 5.15 Change-Id: Ie2c17127e1a00ffc515829526320ba2f71d45af5 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Adaptations for Chromium 94Allan Sandfeld Jensen2021-12-021-2/+2
| | | | | Change-Id: I9fb8998a3a7762b0aea70993ca231f0bbf4f7761 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Adaptations for Chromium 92Allan Sandfeld Jensen2021-12-021-3/+7
| | | | | Change-Id: I1849c130ca75615802744275f6e4212a755c39b4 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Adaptations for Chromium 91Allan Sandfeld Jensen2021-12-021-3/+3
| | | | | Change-Id: Ie0236697615fd67e4f53df3dca013ce39628cc29 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* WebEngineNavigationRequest: add accept/reject and deprecate setActionKirill Burtsev2021-07-211-3/+1
| | | | | | | | | | | | Match naming with others and use accept/reject methods to handle request. Also, allow to use request object after call scope in QML. [ChangeLog][QWebEngineQuick][WebEngineNavigationRequest] setAction(action) is deprecated in favor of new accept/reject methods Pick-to: 6.2 Change-Id: I83252370e2e83017008f6951f98b7ecad119e232 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Get rid of Quick's TestSupport APIPeter Varga2021-07-201-9/+0
| | | | | | | | | | | - Moved TestInputContext and TestInputEvent APIs to tst_qmltests. - Removed loadVisuallyCommitted and use Item.grabToImage to check if page is rendered. - Removed windowCloseRejected signal and use a hidden callback instead. Pick-to: 6.2 Change-Id: Ica6e4c6017426e0171d738a6a59afa557c786698 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Adaptations for 90-basedAllan Sandfeld Jensen2021-07-081-0/+3
| | | | | | Pick-to: 6.2 Change-Id: I8402b044d8e12d75e144a00984b856f3de10bffd Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Make default profile off the recordMichal Klocek2021-06-251-4/+0
| | | | | | | | | | | | | | | Make default profile otr, this prevents accessing data cache which could be created by older other version of Chromium. Allow to register a protocol handler on ort profile. [ChangeLog][QtWebEngineCore] Default profile is off-the-record Off-the-record profile can have registered protocol handlers. Task-number: QTBUG-66068 Pick-to: 6.2 Change-Id: Ief202de5c6734d293cb64d83ad447b1eba19e9a4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Replace testsupport's QQuickWebEngineErrorPage with isErrorPageAllan Sandfeld Jensen2021-06-061-13/+20
| | | | | | | | | | | | | | | | Merge and unify handling of loading started/finished for quick and widgets by removing separate quick's type for monitoring error page load and replace it with an isErrorPage method in WebEngineLoadRequest to indicate, that load ended with an error page being displayed. Effectively this only slightly changes when loading finished gets emitted: now the signal is just postponed until error page is finished loading after initial failure. [ChangeLog][QWebEngineQuick][WebEngineLoadingInfo] New property 'isErrorPage' which indicates that the load resulted in an error page Change-Id: I3e59dc488429d776f7c8e083b6d0489fb30a65fc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Replace FaviconManager with Chromium's Favicon ComponentPeter Varga2021-06-041-29/+0
| | | | | | Task-number: QTBUG-51184 Change-Id: Ie050cb23f2c86841a66ec384bfbcdf0713cffa7c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-05-121-66/+55
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webenginewidgets/printme/printhandler.cpp src/3rdparty src/core/api/qwebenginepage_p.h src/core/content_browser_client_qt.h src/core/web_contents_adapter_client.h src/core/web_contents_delegate_qt.cpp src/core/web_contents_delegate_qt.h src/webenginequick/api/qquickwebengineview_p_p.h tests/auto/quick/qmltests/data/tst_download.qml tests/auto/quick/qmltests/data/tst_viewSoure.qml tests/auto/widgets/loadsignals/tst_loadsignals.cpp tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp Change-Id: I9c1819ec15e13d4f8e244defe860e26274b5d4be
| * Remove tracking of frame which load error pageKirill Burtsev2021-05-061-12/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It was added to suppress progress notification for error page load after failure, but since error page load is reported as a new navigation (which clears list of tracked frames), it was actually doing the opposite thing. The only situation where it suppresses progress is when navigation was not finished (due to invalid domain or network error), but in this case it was real progress change for whole load which should propagate further. Change-Id: Ifd1d681fb5c6495fb3afdc4247364afb4472c959 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| * Fix inconsistent number of load signals and their orderKirill Burtsev2021-05-061-55/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change tries to match how chromium treats one single load. Before the pair of loadStarted/loadFinished methods for api classes was called on delegate's DidStartNavigation/DidFinishNavigation, which might be many within one single logical load. This is true for multiple usecases (like multiple redirects on load, immediate form submit on DOM load, page's subresource load, or just an error page load on failure). Tracking these methods and deciding when to emit signals based on states are error-prone and complicates logic for no benefits. Also it somewhat lies about when real load is done, which is only started and finished on outer methods DidStartLoading/DidStopLoading, which are conveniently called only once for all mentioned usecases. So, this change uses these methods to issue signals for load start/finish, and only makes exception for error page, which is needed for quick's private test support. Fixes: QTBUG-65223 Fixes: QTBUG-76802 Fixes: QTBUG-87089 Fixes: QTBUG-90342 Fixes: QTBUG-91773 Fixes: QTBUG-92063 Change-Id: I9cc99b639030fedd8cf6a9dc04d0869d6be6357d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Adaptations for Chromium 88Allan Sandfeld Jensen2021-04-151-10/+1
| | | | | | | | | | Change-Id: Ie66e95dbb9fbcafe961bb98d5c277f8c32d66b96 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-02-171-4/+24
|\| | | | | | | Change-Id: Idee0142b0e33fdf8ca663f1ef1bcd8b932985043
| * Fix loadFinished signal if page has content but server sends HTTP errorPeter Varga2021-02-051-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For triggering an error page 3 conditions should be fulfilled: - main frame navigation - the page's document is empty - the HTTP status code indicates an error This fix adds check for the empty document and sends loadFinished signal without expecting an error page if the document is not empty. Fixes: QTBUG-90517 Change-Id: I6463d75fb5e682932feca64b0f059f9aa475795c Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-01-251-23/+26
|\| | | | | | | | | | | Including update to 87-based Change-Id: I36b6054e00de97ab055d0bc800cff08d0408fac6
| * Enable hangout services extensionPeter Varga2021-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | [ChangeLog] Enable hangout services extension and implement its WebRTC desktop capture extension API dependency. Fixes: QTBUG-85731 Task-number: QTBUG-51185 Task-number: QTBUG-61676 Change-Id: I7a659c2b0039243ac8d8c58685716ffc55265e3b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Fix some warningsPeter Varga2021-01-161-1/+1
| | | | | | | | | | Change-Id: Ic7cff2556945272761288fedd271796dbf240cb5 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
| * Adaptations for Chromium 87Allan Sandfeld Jensen2021-01-131-3/+5
| | | | | | | | | | Change-Id: Ic4ffd98e02f986dbaf986405360e727c813e696e Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| * Adaptations for Chromium 86Allan Sandfeld Jensen2021-01-131-8/+10
| | | | | | | | | | Change-Id: I7e0ebecdbb68cfff0b574c966f3fa80d28680e1c Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| * Adaptations for Chromium 85Allan Sandfeld Jensen2021-01-131-5/+4
| | | | | | | | | | Change-Id: I33c1af7c431055d95e0fb540246765cce684de15 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| * Adaptations for Chromium 84Allan Sandfeld Jensen2021-01-131-5/+5
| | | | | | | | | | Change-Id: I359805d0bea84147fca6de2e2c7b17b4dcb17bc7 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Merge branch '5.15' into devAllan Sandfeld Jensen2021-01-191-6/+4
|\| | | | | | | | | | | Last commits before 87 update. Change-Id: Id156b0199a8fd354c946cfe604ae8541ba554658
| * Suppress error pages also for http errors if they are disabledKirill Burtsev2021-01-061-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Load with client or server http error results in successful navigation, which leads to 'true' loadFinished result, and subsequent chromium's error page load and display with second set of loadStarted/loadFinished signals. This effectively ignores QWebEngineSettings::ErrorPageEnabled. Fixing it requires submodule change to ask embedder if error pages should also be suppressed for http errors. Also update chromium for required change, which pulls in the following changes: * e71010069b4 Fix embedded builds with printing enabled * f5a93d251cc Allow the embedder to suppress an error page for http errors Change-Id: I731678575439a6dad90dfb89e79b0083c63b49c2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-12-111-19/+47
|\| | | | | | | Change-Id: Id1a1f4ca84697ba18e2604090e3154295fe1858b
| * Stabilize load signals emittingTamas Zakor2020-12-031-14/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the WebContentsDelegateQt::EmitLoadStarted() and the WebContentsDelegateQt::EmitLoadFinished() independent from the WebContentsDelegateQt::LoadProgressChanged() by removing m_lastLoadProgress. Adapt the WebContentsDelegateQt::LoadProgressChanged() to send signal only if load is in progress. Add a new test based on the bugreport. Fix qmltests::WebEngineViewSource::test_viewSourceURL() flaky tests. Fixes: QTBUG-65223 Fixes: QTBUG-87089 Change-Id: I90af4d2e85105dba801beb8102991eb4ef14c6a3 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| * Fix new view request handlingTamas Zakor2020-11-101-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ignore url loading if the request is not from a data url and the Q(Quick)WebEngineNewViewRequest.openIn() is not called on newViewRequested(). Set the missing Q(Quick)WebEngineNewViewRequest::requestedUrl property. Fixes: QTBUG-87378 Change-Id: Idddc9cf075db68dcf5825b3e746d16419d02cfa0 Reviewed-by: Tamas Zakor <ztamas@inf.u-szeged.hu> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Swap widgetCahgned with adapterClientChangedMichal Klocek2020-11-231-1/+2
| | | | | | | | | | | | | | | | This drops dependency on view delegate implementations in web contents adapter client. Change-Id: I73a0dda0a790b7afe3fa774b53db9aa263d48ef9 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2020-09-141-11/+23
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Adaptations for Chromium 83Allan Sandfeld Jensen2020-09-091-5/+9
| | | | | | | | | | Change-Id: I63ed851426b18623d549ceaf87f1b6eeec527966 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
| * Chromium 81-based adaptationsAllan Sandfeld Jensen2020-09-091-2/+6
| | | | | | | | | | Change-Id: Ie422b327025da084bc8038c7a0aadee2db801f29 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
| * Don't send duplicate load progress valuesKirill Burtsev2020-08-311-4/+8
| | | | | | | | | | | | | | | | | | Suppress duplicated progress values coming from chromium. Verify this behavior reliably (and not only 0 and 100 value) by loading html with subresources with minor delay through test http server. Change-Id: Id034dda9012212d54d12fc95d5939ba301577c1c Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Reuse qwebenginesettings from core in qmlMichal Klocek2020-09-111-8/+8
| | | | | | | | | | | | | | | | | | | | Drop duplicated enums. Use qwebenginesettings as private for qquickwebenginesettings. This can most likely be more optimized when profile is moved to core. Change-Id: I04bdc6c5a35556bf6d38a273cefeeee9d2a0a310 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Improve QWebEngineCertificateError apiMichal Klocek2020-08-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * remove const ref from QWebEngineCertificateError Q_GADGET is a value type, QWebEngineCertificateError is pass as const reference from api. This is not so useful since, in qml this will be anyway copied and for c++ this is not useful since reject, ignore, defer methods are all const. Therefore simply pass it by value. * make consistent naming defer(), acceptCertificate(), rejectCertificate() * remove properties 'differed', 'answered' which are use internally, user knows if he calls functions. * error.errorDescription -> error.description() * error.error() -> error.type() [ChangeLog] In QWebEngineCertificateError use acceptCertificate() instead of ignoreCertificiateError() Change-Id: I9ffa500a0a455d98445b066252dd283872740731 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Simplify WebEngineCertificateErrorMichal Klocek2020-08-141-3/+13
| | | | | | | | | | | | | | | | Removes certificateErrorControllerPrivate, moves error handling logic to core. Change-Id: I050f73f1e37eb9ae39ad471fe1673d2b6140cf89 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge remote-tracking branch 'origin/5.15' into devMichael Brüning2020-07-241-0/+9
|\| | | | | | | | | | | | | | | | | Conflicts: src/core/compositor/delegated_frame_node.cpp src/core/core_chromium.pri src/core/render_widget_host_view_qt.cpp Change-Id: I9387151e9647c87fc387095e7b6d8d66560cdf71
| * Disable navigation on back/forward mouse buttons in Qt 5Allan Sandfeld Jensen2020-07-171-0/+9
| | | | | | | | | | | | | | | | Submodule src/3rdparty 809e16e4..840c8e5f: > Make navigation on back/forward mouse buttons optional Change-Id: I191f7781cf9b824b743b80a05a3e819a414ee546 Reviewed-by: Michael Brüning <michael.bruning@qt.io>