path: root/src/webengine/api
Commit message (Collapse)AuthorAgeFilesLines
* Fix WebEngine api build on WindowsZoltan Arvai2014-02-112-0/+5
| | | | | | | | QQuickWebEngineViewPrivate needs a destructor to work right with WebContentsAdapter. Change-Id: I3df1b452eeaf3a7516eace9268884ff6d1211e44 Reviewed-by: Michael Bruning <>
* Implement requestFullscreen for QQuickWebEngineView.Zeno Albisser2014-02-112-0/+32
| | | | | | | | | | | | | | This patch adds a property isFullScreen and a signal fullScreenRequested to QQuickWebEngineViewExperimental. The signal fullScreenRequested is emitted when some web content requests fullscreen through the javascript API. The property isFullScreen is supposed to be set programmatically when the view is being shown fullscreen. This information is then available to the WebContentsDelegateQt when checking if the fullscreen request has been accepted. Change-Id: I04cbb45f263a188d26cc87d70ac53b0fbab63936 Reviewed-by: Jocelyn Turcotte <>
* Add TakeFocus in WebContentsViewQt for passing on tab focus.Zeno Albisser2014-02-102-0/+13
| | | | | | | | | | Chromium calls RenderViewHostDelegate::TakeFocus when the last focusable item within the page was reached. We then have to move the focus on to the next/previous QQuickItem. Change-Id: Id0128053602ff1220c1bced1b218050b66fef659 Reviewed-by: Andras Becsi <>
* Quick: Support reparentingArvid Nilsson2014-01-312-0/+13
| | | | | | | | | | | | | | | | | To support reparenting, we make the compositing surface independent of the window by using gfx::TEXTURE_TRANSPORT. We also need to be able to keep frame data across window changes so we can reconstruct the QSGNode tree in a new context, so extract that data into DelegatedFrameNodeData class. Any context-specific data is still stored in DelegatedFrameNode. Also hook up window changes to WebContents::WasShown/Hidden for Quick. Remove checking of Qt isVisible state, this mechanism is used to sync Chromium with Qt, not the other way around. WasShown/Hidden is orthogonal to Show/Hide, and can use different triggers. However for Widgets it probably makes sense to hook both up to widget visibility. Change-Id: I1ef4b50cd61b8e54b791e03f0b41929c42fec8bf Reviewed-by: Jocelyn Turcotte <>
* WebPage: Implement javaScriptConsoleMessagePierre Rossi2014-01-303-0/+9
| | | | | | | And unskip the corresponding autotest. Change-Id: Ida2dcee38b261b2ba4ad0c5c016f5510ed1590a4 Reviewed-by: Jocelyn Turcotte <>
* Pre-start the render process upon initialiazing the adapterPierre Rossi2014-01-281-3/+2
| | | | | | | | | | | | | | | This should provide us with an initial empty document, which our imported autotests tend to assume all over the place. Initialization of the adapter is moved further down in QQuickWebEngineView's constructor so that the value of q_ptr is set and valid by the time we end up in WebContentsViewQt::CreateViewForWidget. Change-Id: I45d8d61e65caa3a690461b6da44adea9f8981e7e Reviewed-by: Jocelyn Turcotte <> Reviewed-by: Zeno Albisser <> Reviewed-by: Andras Becsi <>
* Fix the build on embedded platformsAndras Becsi2014-01-281-2/+1
| | | | | | | | | | | | | | | We should not include chromium headers outside of core since they might depend on defines or other build options only set in the gyp/ninja environment. This patch removes the need to include net/base/net_errors.h in the API implementation of the QQuickWebEngineView and also removes the chromium source directory from the global include path. This prevents including chromium headers outside of core by mistake and also makes it possible to load the project in QtCreator without disabling indexing. Change-Id: Icd13b6caa52509ef2a1b6b44eaffb34d8ae4addf Reviewed-by: Zeno Albisser <>
* Add loadIgnoreEmptyUrl test case to loadUrl QML test.Szabolcs David2014-01-281-0/+3
| | | | | Change-Id: I56c78aa7e60194888123d372c6dbbb60624856c5 Reviewed-by: Jocelyn Turcotte <>
* Implement QWebEnginePage::toHtml and toPlainTextJocelyn Turcotte2014-01-221-0/+2
| | | | | | | | | | | | | | | | Those methods are now made asynchronous and need to be given a callback to handle the result. Update the code in the browser and fancybrowser examples using std::bind when using C++11 or tr1::bind with C++03 (which should be available with compilers on platforms that we support). Add a (currently failing) earlyToHtml test to make sure that an empty page doesn't crash because of a possibly incomplete attachment of the QtRenderViewObserver. Change-Id: I3ab7cb6f25b91b584dd80df5e4e9ad1e3214348e Reviewed-by: Pierre Rossi <>
* Refactor the callback mechanism used by runJavaScriptJocelyn Turcotte2014-01-221-0/+1
| | | | | | | | | | | | | | | | | | This prepares the way for other API made async like toHtml and toPlainText. Use a callback class with an implicit templated constructor to carry the functor across the API boundary and avoid the intermediate helper method as the ABI that we have to maintain. Also pass the callback result through WebContentsAdapterClient using a bookkeeping ID instead of transferring the callback to WebContentsAdapter. This will allow other calls, which might not already allow passing a callback functor, to use a consisten way of carrying back the result to the top API layer. Change-Id: Ia923767b9c1021a108c26da17d4c41878ef7cb95 Reviewed-by: Pierre Rossi <>
* Qt Quick File PickerPierre Rossi2014-01-152-1/+7
| | | | | Change-Id: I6195c49f1647c78b16d9d47770ab37ba998a61a5 Reviewed-by: Jocelyn Turcotte <>
* JS dialogs in QtQuickPierre Rossi2014-01-152-4/+4
| | | | | | | | | | Refactor JavaScriptDialogManagerQt to support a Qt Quick dialogs friendly approach. Qt Quick dialogs are still missing a prompt, so we use a "handmade" one. This should be solved before 5.3 though. Change-Id: I965df66837b2e81d6e4618a8da1167a37661c26e Reviewed-by: Jocelyn Turcotte <>
* Pave the way for our UI delegation strategy.Pierre Rossi2014-01-152-3/+102
| | | | | | | | | | | | | | | | | | | Starting with the context Menus for QtQuick. Add default UI delegates as a subproject. We allow ourselves to use Qt Quick Controls there for in order to get a nice "out of the box" experience for things like context menus, dialogs, etc while leaving the door open for system embedders to override this. Opting out of the deployment of these QML files is still very primitive but can be done by passing WEBENGINE_CONFIG+=no_ui_delegates at qmake time. Customization of context menus could be done via a qml component, which is probably best kept in experimental for now while we address its shortcomings. Change-Id: I0705b20d5ddd3bb010f9371b65a181c6b02a03e1 Reviewed-by: Jocelyn Turcotte <>
* [Widgets] wire the file pickersPierre Rossi2014-01-151-0/+3
| | | | | | | | | | | | | | | Introduce a new version of chooseFiles in QWebEnginePage. The existing API in WebKit1 seemed a bit dusty in any case (multiple only supported via extensions). Changes are: * oldFile becomes oldFiles, so that we could at a later stage expose the already selected files in the "multiple" case. * a type is introduced, for now limited to multiple selection, but over time, we might consider additions such as directory upload. Change-Id: I14cfea64ce95e892a0a1877c8cb914c5a421409f Reviewed-by: Jocelyn Turcotte <>
* Implement QQuickWebEngineLoadRequest classAdam Kallai2014-01-155-7/+267
| | | | | | | | It contains information about a requested load of a web page. Change-Id: Ie45706adb51ee5bce98e7af01252d9a8389db57d Reviewed-by: Pierre Rossi <> Reviewed-by: Andras Becsi <>
* createWindow QML API for QQuickWebEngineViewJocelyn Turcotte2013-12-232-3/+97
| | | | | | | | | | | | | | | | | | | | | | | | | This implements adoptNewWindow for QQuickWebEngineView. The API is only intended to be used through QML to avoid delegating the QQuickWebEngineViewHandle ownership through a signal parameter. Another limitation of the implementation is currently to fail the handle adoption unless it is done synchronously within the adoptNewWindow call. To support this we would need to delay the call to WebContentsAdapter::initialize which will leave the adapter without a client when returning to the event loop and would require putting null checks everywhere it is used. So I would prefer to keep the API limited and avoid potential crashes. If we want to support asynchronous Loader elements or QML files fetched from the network in the future, the API should be able to scale to the task once we've adjusted the implementation. This also adds basic tabs support in the quicknanobrowser example. The url property is now set imperatively to avoid overwriting the adopted WebContentsAdapter's loading URL. Change-Id: Iba5c5dc3ffa21045f356be131ca15c01b9aee7c8 Reviewed-by: Pierre Rossi <> Reviewed-by: Zeno Albisser <>
* Fix the build on ARMAndras Becsi2013-12-111-1/+1
| | | | | Change-Id: I5130a10d56cc7c25da0eabf51c3657ef58cebaa7 Reviewed-by: Jocelyn Turcotte <>
* Quick: Add experimental.viewport.devicePixelRatioArvid Nilsson2013-12-042-3/+100
| | | | | | | | | | | | | | | | | | | | This specifies a devicePixelRatio to be used by web content instead of the QScreen::devicePixelRatio(). This is necessary on non-iOS mobile devices to remain compatible with the mobile web which assumes devicePixelRatio is computed as the ratio of actual dpi to 160 dpi. Non-iOS mobile platforms may use different criteria to determine the QScreen::devicePixelRatio(), depending on the history of the platform, or simply leave it at 1.0. For QNX, this setting gets a reasonable default value so developers don't have to regularly use this experimental API. These changes were inspired by the Android Chromium port which uses a GetDpiScale() to accomplish the same in content/browser/android/ Change-Id: I1bc8878a47dabcdb6986c4fe5c8c4ac230ae2514 Reviewed-by: Jocelyn Turcotte <>
* Moving sources to src part 1: Move files.Jocelyn Turcotte2013-11-285-0/+586
This only move files without adjusting any paths. This moves: - lib/quick -> src/webengine/api (API files) lib/quick -> src/webengine (other files) This contains the main QtWebEngine module library since <ec7b2ee70a8b2db7fb87f50671a001ddd54697b0>. - lib/widgets -> src/webenginewidgets Also rename this directory to match its module name and rename Api to api. - lib -> src/core - process -> src/process - resources -> src/core/resources - tools/* -> tools/scripts/ The build directory is spread as follow: - build/ -> src/core/ - build/qmake_extras/* -> src/core/ (for the host and target .pro files) - build/qmake -> tools/qmake - Build related scripts -> tools/buildscripts Change-Id: I0cded1de772c99c0c1da6536c9afea353236b4a1 Reviewed-by: Zeno Albisser <> Reviewed-by: Pierre Rossi <> Reviewed-by: Andras Becsi <>