summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix hang when dragging files from file picker onto QWebEngineViewJoerg Bornemann2016-10-261-0/+10
| | | | | | | | | | | | | | | | | | The method WebContentsAdapter::updateDragPosition actively waits for the UpdateDragCursor message, sent by the renderer. This active wait does not work whenever we're currently in a base::MessageLoop::RunTask call, because of its internal recursion guard nestable_tasks_allowed. Add a check for nestable_tasks_allowed and bail out if we know that the active wait will fail. This fixes the hang. Ensure that the modal file picker dialog is shown outside of base::MessageLoop::RunTask. This enables drag 'n drop updates from the file picker to QWebEngineView. Task-number: QTBUG-56488 Change-Id: Ia13ada9c19e7780e12ca633ab1caeac352aca2a9 Reviewed-by: Viktor Engelmann <viktor.engelmann@qt.io> Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Consider multiple contents in mimeDataFromDropData conversionViktor Engelmann2016-10-111-9/+3
| | | | | | | | | | | | content::DropData can have multiple contents (e.g. an <img> tag has itself as .html property, but also the src="..." attribute as .url property. Therefore, we should always consider all 3 cases and not return immediately when we have found the first content. Task-number: QTBUG-55858 Change-Id: Ie13851e8edb9ada45184a19b6ccfe38839bb9923 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Allan Sandfeld Jensen2016-08-021-3/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty src/core/resources/resources.gyp src/webengine/doc/src/qtwebengine-overview.qdoc src/webenginewidgets/api/qwebenginepage.cpp src/webenginewidgets/api/qwebenginescriptcollection.cpp src/webenginewidgets/api/qwebenginescriptcollection_p.h tests/auto/widgets/qwebenginepage/BLACKLIST And readded newly in 5.6 enabled tests to the BLACKLIST. Change-Id: I4ab1fc54ebfaaf940df81b0d8d6bdd15cae8b7c4
| * Switch WebContentsAdapter to using shared pointersAllan Sandfeld Jensen2016-07-011-3/+3
| | | | | | | | | | | | | | | | | | QExplicitSharedDataPointer is meant for value objects, not for shared objects. Instead switch to using QSharedPointer. Change-Id: Ib3791bbcfde627a67508f2819e141d8c538a4a50 Reviewed-by: Michael Brüning <michael.bruning@qt.io> Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
| * Clear internal selected text when searchingAlexandru Croitor2016-07-011-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Previously if a selection was made on a web page, and afterwards a find operation is executed, the selection in the web page would be cleared, but the call to selectedText() would still return the old selection. Make sure selectedText() is always cleared, when starting a find operation, as well as when stopping one. Change-Id: If78f0fa1dd836a52184015e749ef5a84b9f784cd Task-number: QTBUG-54071 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* | Make dropping files onto QWebEngineView more consistentJoerg Bornemann2016-05-251-4/+7
| | | | | | | | | | | | | | | | | | | | | | When dropping files we created a DropData object with file URLs and the text set to a newline-separated list of file URLs. This is inconsistent with what Chromium does and web developers expect. Fill DropData only with one kind of data at a time. Task-number: QTBUG-53573 Change-Id: Ia808ad62389e0dc01b02c6b06182ee697f11ad40 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7.0Michael Bruning2016-05-231-1/+13
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/3rdparty src/core/browser_context_adapter.cpp src/core/web_contents_adapter.cpp src/webengine/doc/src/qtwebengine-platform-notes.qdoc tests/auto/widgets/qwebenginepage/BLACKLIST Change-Id: I768fc954a9a2147fc3669961286163a0a824def3
| * Let setContent / setHtml fail when content is too big to load.Michael Bruning2016-05-201-1/+7
| | | | | | | | | | | | | | | | | | | | Chromium fails silently - except for a log entry - when the size of the content is larger than 2 MB. This was causing trouble because the user was not informed about the failed load at all. Task-number: QTBUG-53414 Change-Id: I80f3f36b5eac72f3809538c19ff314068b75b61d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
| * Fix CXX :visited selectorIlia Kirianovskii2016-05-131-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes highlighting of visited links and now Acid3 test completely works (100 of 100). The reason is that VisitedLinkMaster must be initialized before a new RenderView will be created. Otherwise, it will not handle content::NOTIFICATION_RENDERER_PROCESS_CREATED event and therefore VisitedLinkSlave will be left uninitialized (salt_ is zero). Because of this reason CSS :visited selector was broken and didn't work. Change-Id: I769cd5dbae2ffb95fd128df634a54e562b9cc91d Reviewed-by: Ilia Kirianovskii <ilia.kirianovskii@lgepartner.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Allan Sandfeld Jensen2016-05-091-0/+1
|\| | | | | | | Change-Id: I2843a633721212850db77c772caf24e0ea82b450
| * Reset the selected text of a page when setHtml is called.Alexandru Croitor2016-05-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When text is selected inside a QWebEngineView, the selection is stored in a RenderWidgetHostViewBase instance. When QWebEngineView::setHtml is called, the stored selection is not cleared, and thus requesting for the selected text will return stale data that is not present in the page anymore. Fix consists in calling WebContentsImpl::Unselect() after the new html is loaded and focused in WebContentsAdapter::setContent(). Change-Id: Idd0f3187f324863b9a805af6a288dccfcbd5566f Task-number: QTBUG-53033 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Allan Sandfeld Jensen2016-04-251-1/+10
|\| | | | | | | Change-Id: I329397621f19ba3890be5daf44a6bb2d668ad2d8
| * Use the temporary zoom factor to set the zoom factorMichael Bruning2016-04-211-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | It turns out that using the temporary zoom factor is meant to set the zoom factor for one certain view, and this is actually what we want. Also added auto tests for this. Task-number: QTBUG-51851 Task-number: QTBUG-51969 Change-Id: I8912cbc25637d3c1681026380a2ab3068a964868 Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
| * Fix user-agent override works when setting contentAllan Sandfeld Jensen2016-04-191-0/+1
| | | | | | | | | | | | | | | | Adds test for user-agent override and fixes the override so that it also works when loading with content instead of URLs. Change-Id: I3f61b1d91b7b0908e35216722054168d1c514a87 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | Update spellchecker APIsMichal Klocek2016-04-181-7/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * marks new properties in QQuickWebEngineProfile as FINAL * removes QT_NO_SPELLCHECK from API headers * renames spellCheckLanguages() to availableDictionaries() * removes "togle spellcheck" methods and actions * use WEBENGINE_CONFIG instead of CONFIG for disable the feature at compile time: WEBENGINE_CONFIG+=no_spellcheck Done-With: Peter Varga <pvarga@inf.u-szeged.hu> Task-number: QTBUG-52371 Change-Id: I8c8eff497b9e7afe0cec2edc97dec248151487f2 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Merge branch '5.6' into 5.7Allan Sandfeld Jensen2016-04-111-0/+5
|\| | | | | | | Change-Id: I53645ee5405b1c43807123fd3c196e314cfd1ce9
| * Implement CheckMediaAccessPermissionAllan Sandfeld Jensen2016-04-051-0/+5
| | | | | | | | | | | | | | | | | | | | | | Fixes access of label of MediaStream tracks Also fixes the logged error: WebContentsDelegate::CheckMediaAccessPermission: Not supported. Change-Id: I3fee9ccd9e8b2e5cbd6b707336cc61425a44ba31 Task-number: QTBUG-52216 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Fix recentlyAudible Widgets and Quick API.Alexandru Croitor2016-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Rename all uses of wasRecentlyAudible to recentlyAudible. Add missing recentlyAudible properties. Change QtQuick slots to simple functions. Change affected demobrowser example. Adjust documentation for the API. Change-Id: I5a6f7b8384c0b7e34afaa5c412a5543c210d3ef9 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com> Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
* | Add callback to printing APIMichael Bruning2016-03-161-0/+19
| | | | | | | | | | | | | | Also corrects and updates the printToPDF docs to reflect recent changes. Change-Id: Iffe276a1046d6d55923939f9d72b97cd533017ff Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Basic adaptation to Chromium 49Allan Sandfeld Jensen2016-03-071-8/+10
| | | | | | | | | | | | | | | | Converts types, callbacks and headers to match Chromium 49. Task-number: QTBUG-51173 Change-Id: I544ef46e187105e250fea1b48b72d2c81a906640 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Add rudimentary printing API and add it to example.Michael Bruning2016-02-161-0/+13
| | | | | | | | | | Change-Id: I48141d07e9744bb21d64a5c8724579cb469ba35c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Add FaviconManager to corePeter Varga2016-02-031-0/+6
| | | | | | | | | | | | | | | | | | The new icon manager uses the WebContents::DownloadImage() API for downloading icons. It proposes the best quality among the available favicons via the iconChanged signal. Change-Id: I66a014365b6f6560ff34d40ee870aee84e4e70e4 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Add spell checker supportMichal Klocek2016-02-011-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Integrate chromium spell checker: * add spellchecker and dependencies to build * underline misspelled words in html text areas * right-click context menu shows up to 4 options to correct the misspelled word * toggle spell check from context menu * add new qml and widget api calls to qwebengineprofile to enable/disable spell check, select spell check language, get list of supported languages/dictionaries * register new qml spell check properties for QtWebEngine 1.3 * CONFIG+="no_spellcheck" to remove spellcheck support Change-Id: Ie61434ab9493597d7759a6f33794f6859c4e3a4c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | 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>
* | Fix un-processed drag events not being handled on OSX.Alexandru Croitor2016-01-231-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a QDragMoveEvent is posted, we have to notify Chromium, and wait synchronously, for the possible drag and drop action at the respective coordinates. This is done by executing an inner event loop. The drag move event was processed in the inner event loop as a side-effect, specifically when another event (like a QMouseMove or QKeyPress) was forwarded to Chromium, which in turn called DoWork implicitly. The side effect led to incorrect behavior, when the mouse button is released and the drag operation should be finished. What actually happened is that additional queued DragMove events were being sent by OSX after the mouse release, and the process was stuck in the inner event loop, because Chromium's DoWork was never called. And only after moving the mouse a bit (and thus forwarding MouseMove events), the inner event loop was quit, and the drag operation finished. To actually make Chromium handle the DragMove event, we have to manually call DoWork on the inner event loop. Also because the possible drag and drop action is sent via IPC from the render process to the main process, there is a race condition that the the message might not be handled on the first manual call of DoWork, so we set up a QTimer to continuously call DoWork, thus polling for the message. Once the message is handled, the timer is stopped. In practice this leads to at most two timer timeouts. Change-Id: I8dc37a9c47ea5b675e15ebd138bc0e616b522049 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Add API to set WebChannel on isolated worldAllan Sandfeld Jensen2016-01-151-5/+12
| | | | | | | | | | | | | | | | | | | | | | Make it possible to set a web-channel so that it can only be accessed by private scripts. Pulls in needed API extension in 3rdparty. Task-number: QTBUG-50318 Change-Id: I61bcce5c318dffe0a406ee8cddf31f58a021c22c Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Add methods for running javascript in isolated worldsAllan Sandfeld Jensen2016-01-081-5/+15
| | | | | | | | | | | | | | | | We exposed javascript worlds for user-scripts, this adds variants of runJavaScript that can access those worlds. Change-Id: I5a0b40b863b543cd364c902d0a84ae2c35e2a0b8 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Implement drag and drop supportJoerg Bornemann2016-01-031-0/+156
| | | | | | | | | | | | | | | | | | | | Create a QDrag for drag and drop operations that are started in the web page. React on drag and drop event of QWidget and QQuickItem. Task-number: QTBUG-43008 Change-Id: If09f09de6e6d5b5f02835985a17cc6bc3262f411 Reviewed-by: Alexandru Croitor <alexandru.croitor@theqtcompany.com> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Add support for checking if audio is played in a page.Alexandru Croitor2015-12-151-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | Add support for checking if audio is played in a page, as well as the ability to (un)mute the audio. Modify demobrowser example to show (muted) in the tab title, if the tab is muted, or (audible) if there is audio playing in the tab. Fix HTML5 audio/video (un)mute to also work. Change-Id: I7213645e67be2f9da1c5f96cdf6c7eef5341ae4b Task-number: QTBUG-48788 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Add web action for saving the current web pageJoerg Bornemann2015-12-111-0/+7
| | | | | | | | | | | | | | | | 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>
* | Merge branch '5.6' into devAllan Sandfeld Jensen2015-11-201-2/+2
|\| | | | | | | Change-Id: I05fe27b8321944cf68cc96dfa9dfcaeb54c8c8cd
| * Use consistent naming of Qt-specific Chromium classesAllan Sandfeld Jensen2015-10-291-2/+2
| | | | | | | | | | | | | | | | | | Most of our Qt specific versions of Chromium classes have Qt appended, but a few observers have it prepended. This patch renames them to keep naming consistent. Change-Id: I004b61e16bc47f39a6bbc16a5f5c10585626865c Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Adapting to Chromium 47Allan Sandfeld Jensen2015-10-271-1/+1
| | | | | | | | | | | | | | Updating to Chromium 47 and adapting API. Change-Id: Id465bbcd4facd7c47cb8a9f4bd4e18cbdc0d1120 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devAllan Sandfeld Jensen2015-10-231-0/+6
|\| | | | | | | Change-Id: I5d0d5f65575256673c35558e0fcbf749a1439793
| * Fix ABI breakage due to fullscreen featureAllan Sandfeld Jensen2015-10-191-0/+6
| | | | | | | | | | | | | | | | | | | | | | We can not add a new virtual method without breaking ABI on some platforms, instead we need to use a setter. The API now uses a request object, and a separate signal for canceling, since canceling can not be rejected. Change-Id: If8069c343e86926293c30e8de179bf4e3cbd5886 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.6' into devwip/47-basedAllan Sandfeld Jensen2015-10-141-0/+6
|\| | | | | | | Change-Id: I0569b04ced3456a1d5d91e02e117963115fcf1b2
| * add RequestClose web actionJoerg Bornemann2015-10-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Web pages can set the onbeforeunload handler to let the user confirm whether to leave the page or not. Until now, only when leaving the page via a link, a confirmation was shown. Before actually closing a web page, applications can now trigger the RequestClose web action. This will give the use the chance to confirm or deny the close request. If the request is confirmed, the signal windowCloseRequested is emitted. Task-number: QTBUG-36155 Change-Id: Icc1fabc37a2ac537f674c2f00bc8966e4dc4e610 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Add unselect webactionAllan Sandfeld Jensen2015-10-121-0/+6
| | | | | | | | | | | | | | Adds a web action to clear selection. Change-Id: I203b9fbc7a8f3714695eef043ebc3a8f79c20b75 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Add contentsSize APIAllan Sandfeld Jensen2015-10-121-0/+8
| | | | | | | | | | | | | | | | | | | | Adds API to read contentsSize to go with scrollPosition. This property used to be in QWebFrame in QtWebKit. Change-Id: I498075e4c0ad916e5c96dbfb02101ce8a0c298ee Task-number: QTBUG-48323 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* | Add scrollPosition APIAllan Sandfeld Jensen2015-10-121-0/+8
|/ | | | | | | | | | Adds an API to read the main-frame scrollPosition. In QtWebKit this property used to be in QWebFrame. Task-number: QTBUG-48323 Change-Id: Ic8312afac0dcdcfd8c7fd4589be774d327bb6268 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Allan Sandfeld Jensen2015-09-241-0/+2
|\ | | | | | | Change-Id: Ice3d6e88238940a62d75e7c67f63b626285fccb0
| * Fix assert on exitAllan Sandfeld Jensen2015-09-101-0/+2
| | | | | | | | | | | | | | | | | | | | Remove frame loading error-page when frame is deleted, and make sure WebContents is destroyed before the observer so the observer can observe the full live-span including deletions.. Task-number: QTBUG-47945 Change-Id: I56bec611b8bfbfc6f75a1bc2108efbc80a81729b Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Emit a signal when the rendering process exits.Jake Petroules2015-09-101-0/+32
| | | | | | | | | | | | | | | | | | This allows users to implement a "sad tab" feature and/or track rendering process crashes using a crash reporting service. Task-number: QTBUG-48227 Change-Id: I97ef934fe5d0912cd0f41967a39052316b3c66b0 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Fix selectAll on data urlAllan Sandfeld Jensen2015-09-031-0/+1
| | | | | | | | | | | | | | | | SelectAll only works when there is a focused frame, so we must ensure a frame is focused when the web-contents requests focus. Change-Id: I00d670321b29342fcd447b4b07251df776019f1c Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Add default inspect element context menu itemAllan Sandfeld Jensen2015-09-011-0/+8
| | | | | | | | | | | | | | | | Adds inspect element to the context menu when there is an attached inspector on the page. Change-Id: Id3c8a5be34318c12ab331b6611219bd59b7b70be Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Add exit full screen web actionAllan Sandfeld Jensen2015-08-271-0/+6
| | | | | | | | | | | | | | | | Adds a web action that can be used for exiting fullscreen mode, and include it the context menu whenever in fullscreen mode. Change-Id: I7aa729a86f9ba9df476766cd40f87d9385948fea Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Add inspect element webactionAllan Sandfeld Jensen2015-08-261-0/+9
| | | | | | | | | | | | | | | | | | Adds the missing InspectElement webaction from QtWebKit. It is not added by to any context menus by default and only has an effect when an inspector is attached. Change-Id: Ic8c67c797e5dfe266fb692ffc97577b842458a79 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Rebasing on Chromium 45Allan Sandfeld Jensen2015-08-251-6/+6
| | | | | | | | | | | | | | Fixing the minor differences needed to work with Chromium 45. Change-Id: I5036b4b9a069d45e8dd37e24fab84cdfe5e67acc Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | set Accept-Language in content::RendererPreferencesJoerg Bornemann2015-08-241-0/+1
| | | | | | | | | | | | | | This amends commit 2a56ec7ce4713711b55bb1dfc86a4320d943f606. Change-Id: I8103197f08c985557000de36c37ad80e1ceadf24 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
* | Add API for intercepting url requestsAndras Becsi2015-08-031-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch is adding a QWebEngineUrlRequestInterceptor interface that can be subclassed to observe or intercept all resource requests making it possible to implement browser features like adblocking and setting custom request headers for url requests. The interceptRequest virtual function is executed on the IO thread. This patch also includes a unit test for the testable API parts. Change-Id: Ibe740fc55551a9a5da40794088ccb6d03d913631 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Martin Rotter <rotter.martinos@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>