summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Stop showing speculative framesJüri Valdmann2018-10-291-0/+8
| | | | | | | | | | | | | | | | | | | | | 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>
* Unify updating navigation actionsSzabolcs David2018-10-231-9/+14
| | | | | | | | | | On the Quick side, navigation actions were dependent on the context menu. They were only updated when requesting a new context menu and this is obviously wrong if an action is tied to a button or another type of UI element. Change-Id: I5f14b019b66215f16d027fb57d76f052b1604365 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Disable error pages for external URLsv5.12.0-beta2Jüri Valdmann2018-10-121-6/+4
| | | | | | | | | | | | | Failing to launch an external URL triggers a navigation to "chrome-error://chromewebdata". Navigating to "chrome-error://chromewebdata" results in a failed attempt to launch it as an external URL. The cycle repeats until the computer becomes bored. Match Chromium and disable error pages for external URL load failures. Fixes: QTBUG-63378 Change-Id: I6c401532d658744edc56921b55efd0d040a12b1a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* General adaptations for Chromium 69Allan Sandfeld Jensen2018-09-221-10/+8
| | | | | Change-Id: Ifeaf0ee13213dc5a24d2f2b4655cf7f405cddef7 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Adaptations for Chromium 68Allan Sandfeld Jensen2018-09-221-5/+5
| | | | | | Together-with: Tamas Zakor<ztamas@inf.u-szeged.hu> Change-Id: I805246b6f01cb151fff48588744408c676d87c14 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Return http status code for successfully loaded pagesErwin Kandler2018-08-291-1/+5
| | | | | | | | | WebEngineView supports getting the http status code (error code) for failed loading requests only. This patch lets the user access the status code for successfully loaded pages as well. Change-Id: Ib8dbdfe94eed4d62e731c736c13f60ebd62a23fa Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Rename BrowserContextAdapter to ProfileAdapterMichal Klocek2018-07-091-6/+6
| | | | | | | | | 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>
* Enable client certificate storeAllan Sandfeld Jensen2018-07-081-0/+5
| | | | | | | | | | | | Creates the default client cerficate store for the platform and when given a choice of client certificates forwards to the choice to the application. Only a Widgets API for now. Task-number: QTBUG-54877 Change-Id: Ie15152398d5769579fa0c07e3e3035c2374e9940 Reviewed-by: Michal Klocek <michal.klocek@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>
* Adaptations for Chromium 67Allan Sandfeld Jensen2018-06-261-2/+2
| | | | | Change-Id: I13cedba56012f74651a044d6fa8f0957487bf3eb Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Adaptations for Chromium 66Allan Sandfeld Jensen2018-06-261-3/+5
| | | | | Change-Id: Iee88721a50036d4ef85a23dd1708d4fb84218708 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devAllan Sandfeld Jensen2018-05-291-11/+0
|\ | | | | | | Change-Id: I9b1f2a0317290f0855da03eca9d26878b7faeb0a
| * Apply settings on pending RVH tooPeter Varga2018-05-251-11/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-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>
* | Merge "Merge remote-tracking branch 'origin/5.11' into dev" into ↵Michal Klocek2018-05-181-3/+21
|\ \ | | | | | | | | | refs/staging/dev
| * | Merge remote-tracking branch 'origin/5.11' into devAllan Sandfeld Jensen2018-05-181-3/+21
| |\| | | | | | | | | | Change-Id: Id171407c17533846e8efe0e586d6793a61543438
| | * Keep settings synchronized when RVH swapsPeter Varga2018-05-171-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There can be more than one RenderViewHost assigned to a single WebContents. This is the case when starting a page load results changing processes. When applying settings during the load it updates only the old RVH. This fix applies the settings to the new RVH too after the swap. Task-number: QTBUG-66656 Change-Id: I833415b2a34f58e2a9a18c209a025c82b73aa65a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
| | * Merge remote-tracking branch 'origin/5.11.0' into 5.11Qt Forward Merge Bot2018-05-091-3/+10
| | |\ | | | | | | | | | | | | Change-Id: Id41b0b07a934994471df40de884e1231ee1c0e8e
| | | * Fix invalid site instance when switching browser contextsJüri Valdmann2018-04-301-3/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All pages in a site instance should belong to the same browser context, an invariant which is violated by our WebContentsDelegateQt::OpenURLFromTab. Task-number: QTBUG-67900 Change-Id: I754180bb96de07448ee3058210391f7856f4caeb Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | | Change BrowserContextAdapter to be QPointerMichal Klocek2018-05-181-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Reduce boilerplate code for FaviconManagerMichal Klocek2018-05-171-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Remove private implementation for FaviconManager Make FaviconManager non QObject since there no reason to do so. Change-Id: I8e341f9bd2dbc6f3fa977693383bbbf7349ab0b0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Reduce boilerplate code for WebContentsAdapterMichal Klocek2018-05-071-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | 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>
* / Test of data-url with anchor and base URLAllan Sandfeld Jensen2018-04-201-1/+1
|/ | | | | Change-Id: Ib63727794a794c20b1ca372ab6457c2a8a141762 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* Use wrappers in QtWebEngineCore public interfaceJüri Valdmann2018-04-131-4/+5
| | | | | | | | Stop exporting quota / RegisterProtocolHandler request controller classes, and use the public wrapper classes in WebContentsAdapterClient instead. Change-Id: Iaa380b6ceb4f9464fc05dd012ee5df219f11f189 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Shorten names of permission classesJüri Valdmann2018-04-131-4/+4
| | | | | | | | | | | Remove 'permission' from class and signal names, so e.g. QWebEngineQuotaPermissionRequest becomes QWebEngineQuotaRequest and quotaPermissionRequested becomes quotaRequested. Rename the internal controller classes to public name + "Controller". Change-Id: I247714ab0a2880adbf4ed8ee68f1b78838ae7a14 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Avoid creating temporary blank WebContentsJüri Valdmann2018-04-061-2/+7
| | | | | | | | | | | | | | | | | | | | | - 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>
* 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>
* Adaptations to form validationAllan Sandfeld Jensen2018-03-151-32/+0
| | | | | | | | Form validations messages has moved entirely to being done by Blink. Change-Id: I6742c111fc59f0baba75b8b37f5d0ec9ae2fb920 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Basic adaptations for 65-basedAllan Sandfeld Jensen2018-03-151-1/+1
| | | | | Change-Id: I121b14d6a44e80f5eea4b159c58f7010d472926e Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Remove credentials from view-source URLsPeter Varga2018-03-141-8/+19
| | | | | | Task-number: QTBUG-65997 Change-Id: Icb55326c51f1dfff77e8e862e9ced619be17ead1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix loadStarted signal after an in-page navigationv5.11.0-beta2Peter Varga2018-03-081-1/+1
| | | | | | | | | | | In-page navigations does not trigger loadFinished thus m_lastLoadProgress is not reset to -1. Do not ignore loadStarted signal if m_lastLoadProgress is set to 100 because it can mean a new navigation after an in-page one. Task-number: QTBUG-66869 Change-Id: I2b556fe7e3e097c338bdd7ca47e7384722e7eca9 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Avoid use-after-free of ProtocolHandlerRegistryJüri Valdmann2018-03-081-1/+1
| | | | | Change-Id: Ib84a80472a93f53f3675cb8c2db6fa377322b86b Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Expose actual URL for data URLs instead of the virtual URL in the APIPeter Varga2018-02-211-1/+30
| | | | | | | | | | | Chromium considers the actual URL as "scary" therefore prefers to pass a simpler URL via the WebContents::GetVisibleURL() content API function. For data URLs, use the actual URL instead to keep their anchor information. Task-number: QTBUG-64972 Change-Id: I74db3e5dd22a728656a58e50a4e3fba93b82dae2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add support for registerProtocolHandlerJüri Valdmann2018-02-131-0/+36
| | | | | | | | | | | | | | | | | | | Extend initialization of URLRequestContextGetterQt to create a content::ProtocolHandlerRegistry for each content::BrowserContext and add the registry's URL request interceptor to the front of the interceptor chain. Implement methods in WebContentsDelegateQt to add/remove protocol handlers to/from the ProtocolHandlerRegistry. Add permission request signal and classes for core, quick and widgets. Add widgets autotest. Add signal handlers to quicknanobrowser and simplebrowser. Task-number: QTBUG-62783 Change-Id: I808e7eb9a1cb4d7216686deed4895de14fe46310 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2018-02-021-0/+7
|\ | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix random crashes on exitMichal Klocek2018-01-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | 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-11/+1
| | | | | | | | | | Change-Id: I551c7091bbc0463bed94180313eb2bfe92f0ad84 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | Adaptations for Chromium 62Allan Sandfeld Jensen2018-01-251-2/+1
| | | | | | | | | | 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-4/+21
|\| | | | | | | | | | | | | | | | | | | 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
| * Merge remote-tracking branch 'origin/5.9' into 5.10Allan Sandfeld Jensen2018-01-081-4/+21
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/core/api/qwebengineurlrequestjob.cpp src/core/browser_context_adapter.cpp src/core/renderer/user_resource_controller.cpp src/core/web_engine_context.cpp src/webenginewidgets/api/qwebenginepage.cpp Change-Id: I5278e5e22e1776d42975fc94d70ff8ca4f81fb9a
| | * Fix favicon update from JavaScriptPeter Varga2017-12-131-0/+3
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-64967 Change-Id: Ida79d6cdb682d510e9a2e91e3e3ca263acf34a99 Reviewed-by: Viktor Engelmann <viktor.engelmann@qt.io>
| | * Fix Message Bubble position for High-DPIPeter Varga2017-12-051-4/+18
| | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-64812 Change-Id: I9df71253cf6c541622e431b1ff444fc49269d0c3 Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Introduce devtools frontendAllan Sandfeld Jensen2017-12-061-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes it possible to use devtools without using the remote-debugger Task-number: QTBUG-47899 Task-number: QTBUG-50725 Task-number: QTBUG-50766 Change-Id: Id32e13f773372d9917599ebbb64ab4af61bbf1d8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.10' into dev" into ↵Allan Sandfeld Jensen2017-11-301-18/+15
|\ \ \ | | | | | | | | | | | | refs/staging/dev
| * | | Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2017-11-291-18/+15
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/core/web_event_factory.cpp src/core/web_event_factory.h src/webengine/render_widget_host_view_qt_delegate_quick.h Change-Id: Ic43787e2689c81b501ed395a990190eb67d83a2b
| | * | Stop preserving aborted navigation entriesJüri Valdmann2017-11-141-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider the scenario 1. user enters url "http://localhost:8000/" A new navigation entry is created and committed in the NavigationController. 2. user enters url "http://localhost:8000/download.bin" A new navigation entry is created and a download is triggered, but the pending navigation entry in the NavigationController is neither committed nor discarded (since our WebContentsDelegate's ShouldPreserveAbortedURLs() returns true). 3. user enters url "http://localhost:8000/download.bin" At this point the NavigationController will have "http://localhost:8000/" as the committed navigation entry and "http://localhost:8000/download.bin" as the pending entry. NavigateToPendingEntry will see that the user is trying to navigate again to the same URL as the last pending entry and will therefore identify this new navigation as a reload. However Blink interprets 'reload' to mean reloading the last committed entry, i.e. "http://localhost:8000/", and so we end up trying to download "http://localhost:8000/" instead of "http://localhost:8000/download.bin" as the user might have expected. The patch removes the ShouldPreserveAbortedURLs override and relies on the default implementation which always returns false. As a result the pending navigation entry in step 2 above is discarded once the download has been triggered and the unexpected behavior in step 3 is no longer triggered. Removing the override resurrects QTBUG-48995 where, for example, calling QWebEnginePage::setUrl triggers first a urlChanged signal for the *old* URL. The patch adds url and title properties to WebContentsDelegateQt so that property change signals are triggered only if the properties have actually changed. A consequence of this fix is that the first urlChanged signal is delivered directly from the setUrl/load method and not asynchronously once the loading starts (this is also how Chrome's URL bar is updated). Task-number: QTBUG-63388 Change-Id: Icfa300b165e5e56f1fbc8978a00a237c263df183 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
* | | | Expose an option to hide internal IP addresses from WebRTCAllan Sandfeld Jensen2017-11-291-2/+2
|/ / / | | | | | | | | | | | | | | | Task-number: QTBUG-57505 Change-Id: I8d8f906311ce94b2d9df67cb4479b70c8961c3a6 Reviewed-by: Viktor Engelmann <viktor.engelmann@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devAllan Sandfeld Jensen2017-10-271-4/+11
|\| | | | | | | | | | | Change-Id: Ibc1c881a67bf088ba6fb044e2553c74c7e9e24ca
| * | Adaptations to 61-basedAllan Sandfeld Jensen2017-10-251-2/+6
| | | | | | | | | | | | | | | Change-Id: I5cb198445f283c6cea8187a1a2883896df0ee918 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
| * | Mark redirecting URLs as visitedSzabolcs David2017-10-171-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Store the whole redirect chain of finished navigations in the database of visited links. Chrome does the same thing, except that it implements NavigationURLLoaderDelegate::OnRequestRedirected() for this purpose. Task-number: QTBUG-63579 Change-Id: Iff46c33de14c5e1a7386bd1e2860c832e24d5083 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>