summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.h
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* 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>
* Introduce devtools frontendAllan Sandfeld Jensen2017-12-061-0/+4
| | | | | | | | | | 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>
* Do not stop findText on navigation if no finding in progressPeter Varga2017-11-071-0/+1
| | | | | | | | | Avoid unnecessary unselect calls to prevent to lose active focus on an input field during background load. Task-number: QTBUG-64082 Change-Id: I13e8e2a96254360a78329d6ea2b6858da86a2b5a Reviewed-by: Viktor Engelmann <viktor.engelmann@qt.io>
* Set referrer on download requestsJüri Valdmann2017-09-121-1/+3
| | | | | | | | | Note that the Referer header still won't be sent if the download is triggered via an anchor element with the 'download' attribute: crbug.com/455987 . Task-number: QTBUG-61354 Change-Id: I5af971af916b2190756e3e58f19736072a213922 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Handle content::DropData::file_contentsJoerg Bornemann2017-08-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | DropData::file_contents and DropData::file_description_filename are filled by Chromium if the user drags an image from a web page. Write the file's content into a file with the suggested file name in a temporary directory, and set the drop action to "move". This enables users to drag images from the browser to the desktop or a file browser. The file is moved by the client to the target location. The temporary directory is removed when the page is closed. Note that Chrome doesn't use this temporary directory trick, but employs techniques like XDS [1] on Linux to transfer the data via the native clipboard/DnD MIME object. Unfortunately QDrag doesn't support this. Support could be added, but I consider this solution as good enough. [1] https://www.freedesktop.org/wiki/Specifications/XDS/ Task-number: QTBUG-60790 Change-Id: I44f2b3170a124e861ed4131c421903d895b70715 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Allan Sandfeld Jensen2017-03-021-3/+2
|\ | | | | | | Change-Id: Iff6ab3c287c58d8ec84a1513460bfce5218e8a61
| * Fix Q_ASSERT when dragging an item over WebEngineViewJoerg Bornemann2017-02-211-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When dragging something over a WebEngineView we're waiting for the result of the asynchronous DragTargetDragOver using a RunLoop. The result will be delivered by a call to updateDragAction. The RunLoop will call MessagePumpForUIQt::Run which spins a QEventLoop. The QEventLoop will dispatch more posted QDragMoveEvent objects while we're handling the current QDragMoveEvent. This triggers a recursion guard's Q_ASSERT when dragging from a QtQuick item onto a WebEngineView. When waiting for the DragTargetDragOver result we're not interested in Qt events. Instead of using a RunLoop, implement a poor man's chromium event loop and actively wait for updateDragAction being called. In practice, no more than two iterations of the loop are run until updateDragAction is called. Therefore the extra CPU and sleep times are negligible. Task-number: QTBUG-58920 Change-Id: Icfdf9c680c4c9987ac3dbb41fbc3e1403af0fa9f Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-251-1/+1
|\| | | | | | | | | | | | | | | Conflicts: src/3rdparty tests/auto/widgets/qwebengineview/tst_qwebengineview.cpp Change-Id: I070173576fc4be53689ce0dd9e1fd4133f5814da
| * Fix conversion from blink::WebDragOperation to Qt::DropActionJoerg Bornemann2017-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | blink::WebDragOperation is a bit field, even if it is not used in its blink::WebDragOperationsMask incarnation. In particular, WebDragOperationGeneric can be set in addition to other operations. This fixes situations where UpdateDragCursor is called with multiple bits set in its WebDragOperationArgument and the drag action will be spuriously ignored. Also directly pass the WebDragOperation we get from UpdateDragCursor to chromium's API without converting to QDropAction and then converting it back. Task-number: QTBUG-58037 Change-Id: I5c85699de534771f84db69abf7b98e779872a0f7 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Add methods to issue various types of HTTP requestsViktor Engelmann2017-01-111-1/+3
|/ | | | | | | | | | | | | Added class QWebEngineHttpRequest, which describes a GET or POST HTTP Request. Also added overloads of method "load" to QWebEngineView, QWebEnginePage and WebContentsAdapter, which issue such a request. These can be used for example to simulate form-submissions. Task-number: QTBUG-53314 Task-number: QTBUG-53372 Change-Id: I85ac8cdd3d1557905b35e3172b922aba356d1c41 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Move the QPrinter and QtWidgets related code out of the PDFium wrapperMichael Brüning2016-11-251-8/+1
| | | | | | | | | | | This moves the actual printing using QPrinter to the WebEngineWidgets part of the API. The printsupport module depends on the widgets module and therefore QtWebEngineCore also had a dependency to widgets. This is removed by this change. Change-Id: If6e5745709a59de18f2123b930cbe6e64390c867 Reviewed-by: Michal Klocek <michal.klocek@qt.io>
* Add widgets API for printing on a QPrinterMichael Bruning2016-08-241-0/+7
| | | | | | | | | | | | | | | Renders the content to a PDF document and then renders this on a QPrinter-backed QPainter using the PDFium library. PDFium bitmap to QImage conversion based on work by Paulo Pinheiro <paulvap.os@gmail.com>. [ChangeLog][QtWebEngineWidgets][Printing] Enables printing QWebPage content on a QPrinter. Currently does not support previewing the document. Widgets only for the moment. Change-Id: I9a5264433093379aee90f5e4f69bf2aee8814f2b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add focusOnNavigationEnabled settingAlexandru Croitor2016-08-091-0/+2
| | | | | | | | | | | | | | | | The focusOnNavigationEnabled setting allows changing the behavior of whether a WebEngine view (widget or quick) will automatically get focus, whenever a navigation action happens (load, reload, previous history entry, etc). The default behavior before this patch was to always grab the focus. [ChangeLog][QtWebEngine][General] Add focusOnNavigationEnabled setting which allows controlling whether a web view will receive focus on a navigation request. Previously the view always received the focus. Task-number: QTBUG-52999 Change-Id: I6d30d973a41b53011131f21dcecbf6ec4d652759 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-08-051-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also blacklist tst_QWebEnginePage::comboBoxPopupPositionAfterChildMove() and comboBoxPopupPositionAfterMove(). Conflicts: .qmake.conf src/3rdparty src/core/render_widget_host_view_qt.cpp src/core/resources/resources.gyp src/webengine/doc/src/qtwebengine-platform-notes.qdoc src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h tests/auto/widgets/qwebenginepage/BLACKLIST tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp tools/qmake/mkspecs/features/functions.prf Task-number: QTBUG-55158 Change-Id: I1d73ac9b3ca5293ad3c7e3a56f4c395da930e6f4
| * Merge remote-tracking branch 'origin/5.6' into 5.7Allan Sandfeld Jensen2016-08-021-3/+3
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Add View Source API and make the feature available from context menuPeter Varga2016-08-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtWebEngineQML][QQuickWebEngineView] View Source feature is now supported [ChangeLog][QtWebEngineWidgets][QWebEnginePage] View Source feature is now supported Change-Id: Icc16da71fc6ec95880897fc9744dd8be8c004e00 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | | Introduce QWebEnginePage::saveJoerg Bornemann2016-06-161-1/+1
|/ / | | | | | | | | | | | | | | | | Add the convenience method QWebEnginePage::save for saving pages without the need to explicitly handle download requests. Task-number: QTBUG-51798 Change-Id: I8910ce8cb7c9370d72f2b209c4d2de07c614f6d6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Update spellchecker APIsMichal Klocek2016-04-181-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* | 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/+1
| | | | | | | | | | | | | | Also corrects and updates the printToPDF docs to reflect recent changes. Change-Id: Iffe276a1046d6d55923939f9d72b97cd533017ff Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Add rudimentary printing API and add it to example.Michael Bruning2016-02-161-0/+3
| | | | | | | | | | Change-Id: I48141d07e9744bb21d64a5c8724579cb469ba35c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
* | Add FaviconManager to corePeter Varga2016-02-031-0/+2
| | | | | | | | | | | | | | | | | | 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/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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-2/+2
| | | | | | | | | | | | | | | | 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/+11
| | | | | | | | | | | | | | | | | | | | 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/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | 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/+1
| | | | | | | | | | | | | | | | 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 remote-tracking branch 'origin/5.6' into devAllan Sandfeld Jensen2015-10-231-0/+1
|\| | | | | | | Change-Id: I5d0d5f65575256673c35558e0fcbf749a1439793