summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Only allocate a post data block when postingAllan Sandfeld Jensen2019-02-081-4/+3
| | | | | Change-Id: Ia50b6689bdb182888aba44faf549d17747624833 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Web Notifications APIKirill Burtsev2019-02-061-0/+6
| | | | | | | | | | | | | | 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-10/+0
| | | | | | | Unused method. Change-Id: Iebdd2d0e2391b0aa897674c009a26110fbb51131 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add extension system and PDF viewer to Qt WebEngineMichael Brüning2019-02-011-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Adds the Chromium extensiuon system to Qt WebEngine. Currently, it only exposes internal APIs to the internal PDF viewer extension. To load a PDF, simply navigate to it. This feature can be configured via the webengine-extensions flag and is turned on by default. Needs patch in Chromium 71-based to build. Adaptations to 71-based from 69-based include: * Flag out update installation, add crx file dependency * Move PostTask over to 71-based implementation * Move extensions API providers to 71-based implementaion * Don't use custom guest view and mime handler view delegates * Adapt the URLRequestResourceBundleJob to match new interface * Move extension system initialization to end of profile constructor Change-Id: I4fa5149057291bb5847f048534c11820cd7ff58c Fixes: QTBUG-50556 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Adaptations for Chromium 71Allan Sandfeld Jensen2019-01-281-9/+10
| | | | | | | Change-Id: Ib650113b05dfd4771240804f94e33c07aa317bf2 Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Adaptations for Chromium 70Allan Sandfeld Jensen2019-01-281-8/+11
| | | | | | | Change-Id: I8bb77784dbc8a0b9debd96a4c49421bd34e6a0df Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* Move printing operation to a new threadSzabolcs David2018-12-101-2/+2
| | | | | | | | | | | Printing operations were blocking the UI thread, so applications were irresponsive when printing in large size or high resolution. Introduce a new worker for the painting logic and use shared pointers to carry the data around and avoid copying PDF data between threads. Task-number: QTBUG-68561 Change-Id: I30633380b75acd14f1a1df87985c99540168a9f1 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Stop showing speculative framesJüri Valdmann2018-10-291-7/+2
| | | | | | | | | | | | | | | | | | | | | 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>
* Remove some outdated Qt version checksAllan Sandfeld Jensen2018-10-231-4/+0
| | | | | | | | We can't not build with older than Qt 5.9 anyway due to QSG and qmake changes. Change-Id: Iff0247e70d9ffc1e045e2c571f0089d68df9a589 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Cleanup web_contents_view_qt.hAllan Sandfeld Jensen2018-10-211-0/+1
| | | | | | | It had too many headers, and many files depending on its over inclusion. Change-Id: I5add1c4e07a14e017ac60db75efab5fc11e4166f Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* General adaptations for Chromium 69Allan Sandfeld Jensen2018-09-221-2/+3
| | | | | Change-Id: Ifeaf0ee13213dc5a24d2f2b4655cf7f405cddef7 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Adaptations for Chromium 68Allan Sandfeld Jensen2018-09-221-8/+26
| | | | | | 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-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* WebContentsAdapter: Fix build against Qt 5.9Jüri Valdmann2018-08-231-6/+7
| | | | | | | QTimer::singleShot wants to copy the lambda but LoadURLParams is not copyable. Change-Id: I300b70eef0041294080a15166a50321bb4292cfd Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Michael Brüning2018-08-211-20/+22
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix enum mismatch in WebContentsAdapter::enterDragJüri Valdmann2018-07-131-18/+18
| | | | | | | | | | | | | | | | | | | | | | DragTargetDragEnter expects the 'int key_modifiers' parameter to have values from the enum blink::WebInputEvent::Modifiers and not ui::EventFlags. Also, contrary to the name, mouse modifiers are also expected. Task-number: QTBUG-69231 Change-Id: I2369609775243fded563dde7675c4bc2dfc81021 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
| * Forward mouse and keyboard modifiers from QDropEventJüri Valdmann2018-07-131-3/+4
| | | | | | | | | | | | | | Task-number: QTBUG-69231 Change-Id: I35b503dae7e2d90b26b6e61a4c7c260e45df2b62 Reviewed-by: Filipe Azevedo <filipe.azevedo@kdab.com> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Fix bogus QT_CONFIG usage for printingMichal Klocek2018-08-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | If webengine-printing-and-pdf is disabled we do not compile print_view_manager_qt, therefore print_view_manager_qt.h should never be included. Add missing QT_CONFIG check in web_contents_adapter instead. Change-Id: Ib0477c1f12025cd60ee9799ac06a6b664c65018c Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Make WebChannel an optional featureMichal Klocek2018-08-091-2/+9
| | | | | | | | | | | | | | Add webengine-webchannel feature. Change-Id: I600572180f8169aafe79cf0408527cc087d9a007 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Create WebContents with initially_hidden = trueJüri Valdmann2018-07-161-0/+2
| | | | | | | | | | | | | | Task-number: QTBUG-69360 Change-Id: Ia17ce79a8221aa339c72763a984bf1958935ef96 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Rename BrowserAdapterClient to ProfileAdapterClientMichal Klocek2018-07-091-1/+1
| | | | | | | | | | Change-Id: I1f8c0d2e59c2565b24c8c636553f1b70bcd31774 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Rename BrowserContextAdapter to ProfileAdapterMichal Klocek2018-07-091-19/+19
| | | | | | | | | | | | | | | | | | 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-6/+6
| | | | | | | | | | | | | | | | | | | | 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>
* | Migrate from BUILDFLAG to QT_CONFIGMichal Klocek2018-07-021-9/+9
| | | | | | | | | | | | | | | | | | | | | | During configuration we mapped qt webengine fetures to chromium ones and passed them to gn. We used BUILDFLAG to optionally compile code in core. Use QT_CONFIG directly for qt files and add config sanity checks to make sure requested features are present. Change-Id: I930df114ac9aec8e73139ea9135925fc3ad8e39c Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Adaptations for Chromium 67Allan Sandfeld Jensen2018-06-261-5/+6
| | | | | | | | | | Change-Id: I13cedba56012f74651a044d6fa8f0957487bf3eb Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Adaptations for Chromium 66Allan Sandfeld Jensen2018-06-261-11/+14
| | | | | | | | | | Change-Id: Iee88721a50036d4ef85a23dd1708d4fb84218708 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Use range-based for instead of Q_FOREACHJüri Valdmann2018-06-061-1/+2
| | | | | | | | | | Change-Id: Ibf016b795ff98fddfa29fb5dc63924a2d2159d71 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devAllan Sandfeld Jensen2018-05-291-0/+9
|\| | | | | | | Change-Id: I9b1f2a0317290f0855da03eca9d26878b7faeb0a
| * Apply settings on pending RVH tooPeter Varga2018-05-251-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an improvement of: bab4abab Keep settings synchronized when RVH swaps Updating settings during RVH swap is flaky because it happens after the load start of RenderFrame thus it is not guaranteed the ViewMsg_UpdateWebPreferences message is received by the render process before the load finishes. This means that the setting might not be applied on the current page if it was set during the navigation. The new RVH is created at the very beginning of the navigation, so access it via the pending or speculative main frame of the page thereby make it possible to update its settings before the load of RenderFrame starts. Task-number: QTBUG-66656 Task-number: QTBUG-68424 Change-Id: I4fbba597579551bb3329936ccd7b357cf8daa4ea Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
* | Rename BrowserContextQt to ProfileQtMichal Klocek2018-05-251-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Change BrowserContextAdapter to be QPointerMichal Klocek2018-05-181-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | BrowserContextAdapter is living and accessed only in UI thread, remove QSharedPointer usage and change QWebengineProfile to use QPointer. Prevent BrowserContextAdapter outliving WebEngineContext by setting globalObject as a parent to track WebEngineContext destruction. This commits tries to simplify the life cycle handling of browser context, it removes profile shutdown methods and QWebEngineBrowserContext, which was used to track profile destruction. Task-number: QTBUG-62147 Change-Id: I79f2c38a123cd053e3a59f4900afbdc759a396fe Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Remove keeping browser context as shared pointer in web context adapterMichal Klocek2018-05-181-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-325/+220
|/ | | | | | | | | | | | 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/+2
| | | | | | Change-Id: Ib6763a8a3e1ac1ac98caef39f7e6e75c18344424 Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix crash on launching and quitting nanobrowser with devtools openAllan Sandfeld Jensen2018-04-171-3/+5
| | | | | | | | | Make sure it is opened after initialization of the inspected content, and deleted when the inspected content is closed. Task-number: QTBUG-67642 Change-Id: Ie7218bc437e8c529205ceb7744c4aa0c9ffe6c75 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Avoid creating temporary blank WebContentsJüri Valdmann2018-04-061-20/+140
| | | | | | | | | | | | | | | | | | | | | - 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>
* Remove some unused header includes from corePeter Varga2018-03-211-1/+0
| | | | | Change-Id: Ie5bcf9cfb249f364dbe01a8bee98aada2acdd38f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Cleanup file locationsAllan Sandfeld Jensen2018-03-201-1/+1
| | | | | | | | Move printing and network specific classes to subdirectories so we have fewer files in the main dir. Change-Id: I675b1b8b8fd1588061104cec181087f305b44f98 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Basic adaptations for 65-basedAllan Sandfeld Jensen2018-03-151-3/+2
| | | | | Change-Id: I121b14d6a44e80f5eea4b159c58f7010d472926e Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Basic adaptations for 64-basedAllan Sandfeld Jensen2018-03-151-10/+10
| | | | | Change-Id: I11e2da206e4e59872a38c178f57a5879c1bbf229 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Explicitly use custom margins for printing to pdfMichael Brüning2018-03-061-1/+3
| | | | | | | | | | | | | | | 3cec2ccb0ffdd41a41ab55d4c1ba88d4866e71d1 introduced a regression because it was assumed that the page was only printed to pdf when a filename was given. This is not the case when the pdf data is handed to the callback, though. Correct this by explicitly stating when margins should be used. Task-number: QTBUG-66654 Change-Id: I663f578ff5d01c77cc62e6f3756a17f78168a9aa Reviewed-by: Szabolcs David <davidsz@inf.u-szeged.hu> Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fixup merge of downloadType from 5.10.1Allan Sandfeld Jensen2018-02-211-0/+4
| | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2018-02-021-2/+0
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/core/download_manager_delegate_qt.cpp src/core/download_manager_delegate_qt.h src/core/render_widget_host_view_qt.cpp src/core/web_contents_adapter.cpp src/webengine/api/qquickwebengineview.cpp tests/auto/widgets/qwebenginedownloads/tst_qwebenginedownloads.cpp Change-Id: I2308414ce257ae5bb0fc9f6493aa111a267ff39b
| * Merge "Merge remote-tracking branch 'origin/5.9' into 5.10" into ↵Allan Sandfeld Jensen2018-01-241-1/+1
| |\ | | | | | | | | | refs/staging/5.10
| | * Merge remote-tracking branch 'origin/5.9' into 5.10Allan Sandfeld Jensen2018-01-241-1/+1
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/core/download_manager_delegate_qt.cpp Change-Id: Ica57e582a323c6bd014a64bb615dd9454e656548
| | | * Fix QWebEngineDownloadItem::type()Jüri Valdmann2018-01-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-62640 Change-Id: I2b16f24533b38c20a7071319723382ba240e35f3 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
| * | | Fix random crashes on exitMichal Klocek2018-01-241-2/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Destroy WebContentsDelegateQt before WebContents, since it references already partly deleted WebContentsAdapterClient object. This prevents calls by navigation handling on already destructed web contents adapter client. Task-number: QTBUG-65647 Task-number: QTBUG-47945 Change-Id: I0ed5887b337a43ab89ecbfe05130691b5f1f37ec Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Adaptations for Chromium 63Allan Sandfeld Jensen2018-01-251-4/+6
| | | | | | | | | | | | | | | Change-Id: I551c7091bbc0463bed94180313eb2bfe92f0ad84 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | | Adaptations for Chromium 62Allan Sandfeld Jensen2018-01-251-0/+2
| | | | | | | | | | | | | | | Change-Id: I49cd3c419d4dd1180144c3c07bdd9a628ab73caa Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | | Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2018-01-171-3/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/webengine/api/qquickwebengineview_p_p.h src/webenginewidgets/api/qwebenginepage_p.h tests/auto/quick/qmltests/data/TestWebEngineView.qml Change-Id: Id2acc92e8d0364bdaaf5a63ea2d2cb9cd533ade3