summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Reduce boilerplate code for WebContentsAdapterMichal Klocek2018-05-071-109/+0
| | | | | | | | | | | | 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>
* Basic adaptations for 64-basedAllan Sandfeld Jensen2018-03-151-5/+5
| | | | | Change-Id: I11e2da206e4e59872a38c178f57a5879c1bbf229 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Introduce devtools frontendAllan Sandfeld Jensen2017-12-061-0/+2
| | | | | | | | | | 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>
* 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>
* Fix Q_ASSERT when dragging an item over WebEngineViewJoerg Bornemann2017-02-211-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Fix canceling drag and drop actionsJoerg Bornemann2017-01-261-0/+3
| | | | | | | | | | RenderViewHost::DragSourceEndedAt must be called after dropping and after canceling a drag. Otherwise scripts running on the web page do not get properly notified. Task-number: QTBUG-58037 Change-Id: Ia245131c59f03f3331158bea6cc2f53bce50f989 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Fix conversion from blink::WebDragOperation to Qt::DropActionJoerg Bornemann2017-01-181-1/+2
| | | | | | | | | | | | | | | | | | 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>
* Fix drops that originate outside the WebEngineViewJoerg Bornemann2016-11-111-1/+1
| | | | | | | | | | | Dragging things from another application onto QWebEngineView crashed. RenderViewHost::DragTargetDrop now requires a DropData object. Save the DropData object also in the case where we create it for a drag from outside. Change-Id: I8409500a4b27d06aeec02dce9856aca7e1415402 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Viktor Engelmann <viktor.engelmann@qt.io>
* Adaptations to Chromium 52Allan Sandfeld Jensen2016-09-141-5/+4
| | | | | Change-Id: Idf8a511ba26d263fd9d014d87d5e1101d706da71 Reviewed-by: Michael Brüning <michael.bruning@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Allan Sandfeld Jensen2016-04-251-2/+2
|\ | | | | | | Change-Id: I329397621f19ba3890be5daf44a6bb2d668ad2d8
| * Switch BrowserContextAdapter to QSharedPointerAllan Sandfeld Jensen2016-04-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | BrowserContextAdapter is not a form of shared data, and using QExplicitSharedDataPointer on it as always been a misuse of the class. Instead we should switch it to QSharedPointer, which also allows us to use QWeakPointer. Change-Id: I8eb489b4a12d3fdddcde55821be294814a156a9d Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Michal Klocek <michal.klocek@theqtcompany.com>
* | Rename UserScriptController/Host to UserResourceController/HostSzabolcs David2016-02-101-1/+0
| | | | | | | | | | | | | | These classes can operate user stylesheets too. Change-Id: Ia283af92e52a822b26003ff65e0e7dc391b0904d 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/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+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>
* | 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>
* | 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-2/+1
|/ | | | | | | Updating to Chromium 47 and adapting API. Change-Id: Id465bbcd4facd7c47cb8a9f4bd4e18cbdc0d1120 Reviewed-by: Michael Brüning <michael.bruning@theqtcompany.com>
* Add private header warningKai Koehne2015-07-241-0/+11
| | | | | Change-Id: I95ae03b34631f166d2eed68e20282eb624ff408a Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Add namespace to internal QtWebEngine APIAllan Sandfeld Jensen2015-03-021-2/+8
| | | | | | | | Adds the QtWebEngineCore namespace to all internal core API. This ensures we don't export any internal symbols in the global namespace. Change-Id: I26af888ea7c6c4c4d0f04c24a377c1a9d3c92751 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Introduce a user scripts mechanismPierre Rossi2015-02-211-0/+1
| | | | | | | | | | | | | | | Allowing programmatic injection of JavaScript to accomplish all sorts of tasks on the render process side. This API gives control over the point during the loading phase at which the script is run, whether it is run on sub-frames or not, as well as the JavaScript world it is run in (either the page's main world, or an arbitrary isolated world). This only has the Widgets API. The Quick API, tests and docs are coming in separate patches Change-Id: Ia1c79f68f8dfd4d964281d9723d09062ed7abe46 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-161-7/+7
| | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Change-Id: Ieb6bac7a1be5c25eb7cb917495b58b6a870ca6d4 Reviewed-by: Pierre Rossi <pierre.rossi@theqtcompany.com>
* Integrate with WebChannelPierre Rossi2015-02-121-0/+4
| | | | | | | | | | Provide a transport mechanism for WebChannel over chromium IPC and expose WebChannel in our experimental QML API. Co-authored by Milian Wolff. Change-Id: Ia24b1d4ebc8515de677d4849ec33cb55c963918e Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
* Introduce QWebEngineProfile APIAllan Sandfeld Jensen2014-12-121-0/+4
| | | | | | | | | | | | | | | Introduces initial widgets API for the Chromium BrowserContext. Adds API for controlling cookie jar policy, user-agent string and cache and persistent data paths. Similar QML API will follow in another patch. [ChangeLog][QtWebEngineWidgets][QWebEngineProfile] New API for profiles applying to groups of QWebEnginePages. Change-Id: I3c4ef4053fde7564af29178c91a0aca8a2b61a5f Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Update license headers.Pierre Rossi2014-08-281-14/+10
| | | | | | | | Because the files were recent additions or for other unclear reasons, not all the files were updated to reflect the license change. Change-Id: I6898f6f4f993f1efa9489382f0b94af285f8c4f5 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Handle new window/tab modifiers also on normal navigationsJocelyn Turcotte2014-08-151-0/+67
AddNewContents is only called when window.open is called from JavaScript. We also want the shift/ctrl modifiers to trigger normal links to open in the requested disposition. In this case OpenURLFromTab will pass the detected disposition and we must create a new WebContents ourselves. Use the same code path going through WebContentsAdapterClient::adoptNewWindow except that we pass a null WebContents pointer to the WebContentsAdapter constructor and let it create its own when initialized. Change-Id: I817b0e72aec12723bf92d9b7ad85c1cecbf5e408 Reviewed-by: Andras Becsi <andras.becsi@digia.com>