summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.h
Commit message (Collapse)AuthorAgeFilesLines
* Add QWebEngineFrame and basic APIMoss Heim8 days1-0/+14
| | | | | | | | | | | | This object represents a frame on a web page, e.g. a <frame> or <iframe> element. Frames can be found through QWebEnginePage::mainFrame() and findFrameByName(). Also provides some basic getters on QWebEngineFrame and tests. Change-Id: If3905c6ecd14cf6c3508c65edc98f49415739489 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Remove the use of Q_WEBENGINECORE_PRIVATE_EXPORTAlexey Edelev2024-01-161-1/+1
| | | | | | Task-number: QTBUG-117983 Change-Id: I3f5b90c0d43071a5c8ebc4096995ce5e1e65aebb Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Remove QWebEngineUrlResponseInterceptor APIMichael Brüning2023-08-241-3/+0
| | | | | | | | | | | | | | | | | It has been found to not have any real effect, therefore, we remove it again to not release a non-functional API and create false expectations in users. This reverts commits 3f5de5fab74e6c152cdf5d04f3d893feaa31790b ab21f39c6a54be331dd8a155d3374bfe790e0274 (parts) 082eef1916a86d6d5e0c751d271c7c8a1a5e457d 5e257fb57a211f95556ec387fe6f262a60cbb6fe Pick-to: 6.6 Task-number: QTBUG-61071 Change-Id: Ifb33e32128e77dfffed863a1a7501ba21796692d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add QWebEnginePage::devToolsId()Benjamin Terrier2023-05-311-0/+1
| | | | | | | | [ChangeLog][WebEngineCore] Add QWebEnginePage::devToolsId() [ChangeLog][WebEngineView] Add devToolsId property Change-Id: I16e8a27d595b010239557c2a3af2d3b39976cd46 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* QWebEngineUrlResponseInterceptor: Implement new URL response interceptorYigit Akcay2023-03-101-0/+3
| | | | | | | | | | | | | | | | | | | | | This patch adds the QWebEngineUrlResponseInterceptor abstract class, which, when implemented, allows a user to intercept response headers and modify them in any way they like. A response interceptor can be set via QWebEngineProfile::setUrlResponseInterceptor(), QQuickWebEngineProfile::setUrlResponseInterceptor() or QWebEnginePage::setUrlResponseInterceptor(). Also, the QWebEngineUrlResponseInfo class is implemented, which contains the request and response data to be used with the response interceptor. If a response interceptor is set in the profile and page, the one in the profile takes precedence. Fixes: QTBUG-61071 Change-Id: I484d14373ff597b1d531541c066f0102bae28c72 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Support LTR and RTL text directions in input fieldsSzabolcs David2023-02-151-0/+1
| | | | | | | | | | Implement WebActions to temporarily change text direction directly from context menu - like Chrome does. They only work for the selected input field. Omit the "default" option since it is always grayed out in Chrome. Task-number: QTWB-67 Change-Id: I4bacbd82c6bd7261ac465eec9da3776613f98074 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@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>
* Quick: Add support for replacing touch handles with delegatesBalazs Egedi2022-05-041-0/+1
| | | | | | Task-number: QTBUG-85043 Change-Id: I1c87aff352e07eb309d5ba8747b9e50a191d478e Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Fix printing PDF filesSzabolcs David2022-01-121-0/+1
| | | | | | | | | | | Delegate printing task down to the guest WebContents if any is present. Also update PrintWebViewHelperDelegateQt to find the plugin element properly for printing. Task-number: QTBUG-98941 Pick-to: 6.3 6.2 6.2.3 5.15 Change-Id: I81004a2275e0870a17565af527b1450472afb24b Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Adaptations for Chromium 94Allan Sandfeld Jensen2021-12-021-0/+1
| | | | | Change-Id: I9fb8998a3a7762b0aea70993ca231f0bbf4f7761 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Add QPageRanges to PDF printingAllan Sandfeld Jensen2021-06-221-2/+3
| | | | | | | Pick-to: 6.2 Task-number: QTBUG-73497 Change-Id: I0a66c4f1767c54b0bcc9f9a3b61e29c43ec20177 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Clean up header includes and friend classes in corePeter Varga2021-06-171-14/+9
| | | | | | Pick-to: 6.2 Change-Id: I394821d57a9cf379869d3611996c8394fbc6c60e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Replace FaviconManager with Chromium's Favicon ComponentPeter Varga2021-06-041-1/+1
| | | | | | Task-number: QTBUG-51184 Change-Id: Ie050cb23f2c86841a66ec384bfbcdf0713cffa7c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add WebEngineWidgets, WebEngineQuick modules cmake buildMichal Klocek2021-05-191-2/+2
| | | | | | | | | Fix some library dependencies and make proper header includes in core. Task-number: QTBUG-91760 Change-Id: I415361dd42ef2cc39716ce3f5f56e6e8556ac4c8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devAllan Sandfeld Jensen2021-01-251-2/+7
|\ | | | | | | | | | | Including update to 87-based Change-Id: I36b6054e00de97ab055d0bc800cff08d0408fac6
| * Adaptations for Chromium 87Allan Sandfeld Jensen2021-01-131-2/+7
| | | | | | | | | | Change-Id: Ic4ffd98e02f986dbaf986405360e727c813e696e Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Merge branch '5.15' into devAllan Sandfeld Jensen2021-01-191-2/+2
|\| | | | | | | | | | | Last commits before 87 update. Change-Id: Id156b0199a8fd354c946cfe604ae8541ba554658
| * Migrate render_view_observer_qt to mojoMichal Klocek2020-12-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Since mojo interface no longer works on render view, but on render frame rename the class to be WebEnginePageHost and WebEnginePageRenderFrame Keep SetBackgroundColor render message, since it is required to things work. Change-Id: I4d6b70dd448926f8ac2d75d2b87f3d490a4cfefb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Merge all webenginecontextmenudata wrappers into one classMichal Klocek2020-08-121-0/+1
|/ | | | | | | | | | | | | | | | | | | | | | Introduce new class qwebenginecontextmenurequest in core which merges: * qquickwebenginecontextmenurequest * qwebenginecontextmenudata * implictly shared webenginecontextdata Unfortunately new class has to be QObject, since we want to reuse it qml. Q_GADGET can be used only as a value type, however we need to know if request is accepted or not in qml, therefore it must be passed as pointer. Since we use QObject now, class is no longer implicitly shared, however we only allocate request once and reuse the object for every new request (it is still copied in qml just to keep it aligned with other request handlers) [ChangleLog] QWebEngineContextMenuRequest is replacement for QWebEngineContextMenuData Change-Id: Ib387ec2065361a4bacc20675ca7352ab75a0e436 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Add support for clearing the feature requestAllan Sandfeld Jensen2020-05-201-1/+1
| | | | | | Task-number: QTBUG-83476 Change-Id: I63ad9801e3e97f7fdac959600c69c04d0105be1f Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Revive Pointer Lock featureSzabolcs David2020-05-041-1/+3
| | | | | | | | | | | | | | | This change fixes several issues: - Accepting mouse lock permission from modal dialog was not working on Linux. XCB needs some time to activate the parent window after accepting the dialog and we expected to have immediate active focus. - Implementation of RenderWidgetHostViewBase::IsMouseLocked() was missing. - Fixed event.movementX/movementY by disabling ConsolidatedMovementXY feature. Calculate movement properties in WebEngine instead of blink. Task-number: QTBUG-83294 Change-Id: Ic03d05c1026a113cf5e8d22544fc508d9f285876 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Move request interceptor to ui threadMichal Klocek2020-04-201-0/+5
| | | | | | | | | | | | | We use now network service avoid io-ui-io-ui hops, pipe proxying url loader factory directly to ui thread. This solves thread safty issues. Add deprecated request interceptor test cases. Task-number: QTBUG-83082 Task-number: QTBUG-82999 Change-Id: I38778cf1a70789c5e92e04c93d1c93e2cc4c765a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Join some features request and response functionsAllan Sandfeld Jensen2020-04-151-2/+1
| | | | | | | Will make it easier to expands with more features in the future Change-Id: Ic7c1aca23a543c95a4873471c918f74606be2053 Reviewed-by: Kirill Burtsev <kirill.burtsev@qt.io>
* Merge remote-tracking branch 'origin/5.14' into 5.15Allan Sandfeld Jensen2020-02-271-0/+1
|\ | | | | | | | | | | | | | | Conflicts: src/core/renderer_host/web_channel_ipc_transport_host.cpp tests/auto/widgets/qwebengineprofile/tst_qwebengineprofile.cpp Change-Id: I47f2b893bc9f27cd9df641f76badc9e53b482ad4
| * Clear previous page text selection on new navigation unconditionallyKirill Burtsev2020-02-261-0/+1
| | | | | | | | | | | | | | | | | | | | Remove code duplication on triggering new url load, and use direct code to clear SelectedText instead of CollapseSelection as it assumes focused frame and might be ignored. Fixes: QTBUG-81574 Change-Id: I01cf02967e118f407c8a3997e176d5b258478a5a Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Add getter/signal to get the render process PIDFlorian Bruhin2020-02-011-0/+1
|/ | | | | | | | | | | | This can useful for e.g. implementing something like the "Task manager" in Chromium or otherwise interacting with the render process (e.g. to kill it for some reason while debugging). [ChangeLog] Add a renderProcessPid() getter to (Q)WebEnginePage which allows getting the process ID of the underlying render process. Change-Id: Id5d59be9b6bd46ffc3a6aa480cb5ff7bd3b8aa31 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Refactor findText handlingPeter Varga2019-08-221-3/+2
| | | | | | | | | | | Move most of the findText logic to the QtWebEngineCore::FindTextHelper class. This change also separates findText callbacks in the new class for getting rid of the request ID conversion and make it easier to remove them in Qt6. Task-number: QTBUG-50420 Change-Id: I348cedd0f90a49f9b360165c46319aeed2c236c0 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Adaptations for Chromium 75Allan Sandfeld Jensen2019-07-101-0/+3
| | | | | Change-Id: Idad08244e0c749a9f70f5eb9f8cd236039b941b3 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Merge remote-tracking branch 'origin/5.13' into devJüri Valdmann2019-07-021-0/+1
|\ | | | | | | Change-Id: I806417dd7a6d2594a86ee49feedc4ad9ee48add2
| * Merge remote-tracking branch 'origin/5.12' into 5.13Allan Sandfeld Jensen2019-06-111-0/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/3rdparty src/core/configure.json src/core/profile_io_data_qt.cpp tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp Change-Id: Ie8ae4aa03881a0733ff497fff46e3f7040735650
| | * Disable edit actions when content has no focused framePeter Varga2019-05-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-75505 Change-Id: Ia1329ff554a86e307aa7995e9af1665ea6c5e64c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Implement page lifecycle APIJüri Valdmann2019-05-241-3/+27
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtWebEngine][WebEngineView] WebEngineView now supports lifecycle states that can be used for reducing CPU and memory consumption of invisible views. [ChangeLog][QtWebEngineWidgets][QWebEnginePage] QWebEnginePage now supports lifecycle states that can be used for reducing CPU and memory consumption of invisible pages. Fixes: QTBUG-74166 Fixes: QTBUG-55079 Change-Id: I7d70c85dc995bd17c9fe91385a8e2750dbc0a627 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Switch export macros to standard formAllan Sandfeld Jensen2019-04-011-1/+1
| | | | | | | | | | | | | | | | | | | | Qt expects the export macros to have Q_ prefixes, otherwise the symbol versioning script won't find them and mark them. Task-number: QTBUG-74752 Change-Id: I1e057802f6715d170bdd9074f281e73fb96c9e52 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Web Notifications APIKirill Burtsev2019-02-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements API for end-user notifications. Co-authored by Allan Sandfeld Jensen [ChangeLog][Profile] Support for Web Notifications API for end-user notifications through QWebEngineNotification Task-number: QTBUG-50995 Fixes: QTBUG-51191 Change-Id: Icebaaa05275a713e801f1f8ecdaaec725fa264c8 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Delete WebContentsAdapter::dpiScaleChanged()Jüri Valdmann2019-02-011-1/+0
|/ | | | | | | Unused method. Change-Id: Iebdd2d0e2391b0aa897674c009a26110fbb51131 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Stop showing speculative framesJüri Valdmann2018-10-291-2/+0
| | | | | | | | | | | | | | | | | | | | | Chromium creates "speculative" frames (RenderFrameHost and company) for pending cross-process navigations (and maybe other navigations too). For example, a redirect from http://qt.io to https://qt.io will trigger this, as described in the bug report. These speculative frames are loading in the background and only shown once they are officially ready (as decided by the RenderFrameHostManager and signaled to WebContentsObserver::RenderViewHostChanged). At least, this is how it's supposed to work and how it works in Chrome. In WebEngine, however, we actually show these speculative frames as soon as they are created and before they are ready. This runs into the problem that the if the speculative frame is dropped (instead of committed), then Chromium will not ask us to re-show the old frame (since it hasn't actually asked to us to show the new frame, it naturally assumes we are still showing the old one). Fixes: QTBUG-68727 Change-Id: I9d53035ce60e3a002d5412d4473d940a32644b5d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Adaptations for Chromium 68Allan Sandfeld Jensen2018-09-221-2/+2
| | | | | | Together-with: Tamas Zakor<ztamas@inf.u-szeged.hu> Change-Id: I805246b6f01cb151fff48588744408c676d87c14 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Fix issues with qml bindings accessing non-existing adapterMichal Klocek2018-09-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | We have currently two levels of initialization for WebEngineView: the profile initialization and the adapter initialization. The adapter initialization is delayed to first navigation request to pick the right initial site instance and avoid creating dummy/blank WebContents, which in turn would start unnecessary render process. Profile initialization is delayed to make sure we avoid unnecessary default profile creations. Created profiles use filestorage. Unfortunately qml will call QQuickItem::componentComplete() only when the root element is completed and the bindings can be already in use by that time. Profile initialization has to take place before adapter initialization. Construct adapter together with WebEngineView, but create and initialize profile before adapter initialization. Go through WebEngineView and fix emitting signals based on adapter initialization. Most of the signals are emitted on initializationFinished(). Task-number: QTBUG-70248 Change-Id: I2acd8bff761c692a360733cbf537de53e1295695 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Michael Brüning2018-08-211-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf configure.json examples/webenginewidgets/markdowneditor/resources/3rdparty/marked.js examples/webenginewidgets/markdowneditor/resources/3rdparty/qt_attribution.json examples/webenginewidgets/markdowneditor/resources/markdowneditor.qrc mkspecs/features/platform.prf src/3rdparty src/core/media_capture_devices_dispatcher.cpp src/core/net/url_request_context_getter_qt.cpp src/core/net/url_request_context_getter_qt.h src/core/web_contents_adapter.cpp Change-Id: I467133ba455b1f85f6bb61793794c31cb1094541
| * Forward mouse and keyboard modifiers from QDropEventJüri Valdmann2018-07-131-1/+2
| | | | | | | | | | | | | | Task-number: QTBUG-69231 Change-Id: I35b503dae7e2d90b26b6e61a4c7c260e45df2b62 Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Make WebChannel an optional featureMichal Klocek2018-08-091-0/+4
| | | | | | | | | | | | | | Add webengine-webchannel feature. Change-Id: I600572180f8169aafe79cf0408527cc087d9a007 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Rename BrowserContextAdapter to ProfileAdapterMichal Klocek2018-07-091-2/+2
| | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | 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>
* | Update export symbols for webenginecore moduleMichal Klocek2018-06-151-2/+13
| | | | | | | | | | | | | | | | | | | | | | Use own WEBENGINECORE_EXPORT define, mark most headers private and use WEBENGINECORE_PRIVATE_EXPORT for it. For sanity, add "WARNING" as for private headers even though they are never installed. Change-Id: I523d28c1d00217f48bc63dabf138dd3a7eb482d4 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Rename BrowserContextQt to ProfileQtMichal Klocek2018-05-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Remove keeping browser context as shared pointer in web context adapterMichal Klocek2018-05-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In widgets we document that web contents can not out live browser context ie. WebEngineProfile can not be deleted before WebEnginePage which uses it. In qml we can not be sure the order in which objects are garbage collected. We used shared pointers to keep order of destruction. Unfortunately shared pointers do not work well with corner cases, and we added more and more code to deal with that (shutdown methods + qpointers wrapping qsharedpointers). In order to remove growing complexity remove usage of shared pointers to keep strict deletion order. Remove shared pointer from WebContentsAdapter and simply track the WebContents, that is used by the given BrowserContext. Force deletion of webcontents first. Change-Id: I05f886a0094d971b03f9a35e12c4b4672f0fe4ce Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Reduce boilerplate code for WebContentsAdapterMichal Klocek2018-05-071-3/+22
|/ | | | | | | | | | | | We do not need WebContentsAdapterPrivate. Remove it. This change also removes scoped ref to WebEngineContext in WebContentsAdapter. Change-Id: I0a9acec4d5500342ffa41865cfc775fdb0e68ac4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Make sure we can build with -no-feature-draganddropJoerg Bornemann2018-04-171-0/+3
| | | | | | Change-Id: Ib6763a8a3e1ac1ac98caef39f7e6e75c18344424 Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Avoid creating temporary blank WebContentsJüri Valdmann2018-04-061-7/+17
| | | | | | | | | | | | | | | | | | | | | - Avoid creating a blank WebContents for new QWebEnginePages only to replace it with a different blank WebContents moments later. This problem is already solved in QQuickWebEngineView by lazy initialization, therefore the patch moves this lazy initialization into WebContentsAdapter itself so that it can be applied to both QQuickWebEngineView and QWebEnginePage. - Try to delay WebContents creation until the first navigation so that we have enough information available to pick the right initial SiteInstance when calling WebContents::Create. This is done by triggering WebContents creation from the first call to a WebContentsAdapter::load* method. - Use the SiteInstance from WebContentsDelegate::OpenURLFromTab. This method gets a SiteInstance pointer which we should give to WebContents::Create. Task-number: QTBUG-65561 Task-number: QTBUG-67163 Change-Id: Id7b351998adefb810cf27c61a1447b61d7f4c606 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Basic adaptations for 64-basedAllan Sandfeld Jensen2018-03-151-3/+3
| | | | | Change-Id: I11e2da206e4e59872a38c178f57a5879c1bbf229 Reviewed-by: Michael Brüning <michael.bruning@qt.io>