summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Implement QWebEnginePage::toHtml and toPlainTextJocelyn Turcotte2014-01-2212-2/+111
| | | | | | | | | | | | | | | | 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 <pierre.rossi@gmail.com>
* Add a stub message system to communicate with the blink WebViewJocelyn Turcotte2014-01-2213-2/+428
| | | | | | | | | | | | | | | | | This follows the model used by the Android WebView's AwRenderViewExt class. QtRenderViewObserverHost is attached to the WebContents and QtRenderViewObserver is attached to the RenderView in the render process. Both can exchange messages together and allow async commands to be carried from WebContentsAdapter and the result sent back through WebContentsAdapterClient. This patch also adds a renderer subdirectory to start matching the directory structure of Chromium. Change-Id: I724ca2fe2a597dcd2a15e8e1a23c4eeba1190703 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Refactor the callback mechanism used by runJavaScriptJocelyn Turcotte2014-01-227-49/+59
| | | | | | | | | | | | | | | | | | 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 <pierre.rossi@gmail.com>
* Implement QWebEnginePage::setHtml and setContentJocelyn Turcotte2014-01-224-0/+39
| | | | | | | | | | Load a generated data: URL to carry the data. This is not as efficient as it could be but the behavior matches and this should be fine for now. Change-Id: I26ad2e5976025a3044fb03f066074ce6dd34e575 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Fix QWebEngineView to page reattachment.Jocelyn Turcotte2014-01-175-3/+21
| | | | | | | | This fixes the crash in tst_QWebEngineView::reusePage. Also add a test to check the case where show() would react incorrectly. Change-Id: I40247c7c225d74b26675b6a7fa5ff1f06d3bb3e6 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Qt Quick File PickerPierre Rossi2014-01-157-2/+158
| | | | | Change-Id: I6195c49f1647c78b16d9d47770ab37ba998a61a5 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* JS dialogs in QtQuickPierre Rossi2014-01-1520-27/+597
| | | | | | | | | | 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 <jocelyn.turcotte@digia.com>
* Pave the way for our UI delegation strategy.Pierre Rossi2014-01-1511-5/+626
| | | | | | | | | | | | | | | | | | | 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 <jocelyn.turcotte@digia.com>
* [Widgets] wire the file pickersPierre Rossi2014-01-1510-13/+137
| | | | | | | | | | | | | | | 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 <jocelyn.turcotte@digia.com>
* Fix placement of webengine processSimon Hausmann2014-01-151-2/+2
| | | | | | | | | In developer (non-prefix) builds, the binary goes to $$MODULE_BASE_OUTDIR/libexec, which is practically qtbase/libexec. In prefix builds it'll be linked to $module_toplevel/libexec and installed into $prefix/libexec. Change-Id: Ia42519f3113976e707fbda9e09dbf7ef6e235924 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Implement QQuickWebEngineLoadRequest classAdam Kallai2014-01-1511-11/+277
| | | | | | | | It contains information about a requested load of a web page. Change-Id: Ie45706adb51ee5bce98e7af01252d9a8389db57d Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix ContentMain calling in processMain for WindowsZoltan Arvai2014-01-131-0/+11
| | | | | | | | | | ContentMain has a different parameter list for Windows. Currently no sandbox is in use, just fitting in with the required parameters. See chromium/content/app/content_main.cc. Change-Id: I6c3918efaafbf48bd4a07f377be51c22c5355cd0 Reviewed-by: Andras Becsi <andras.becsi@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Fix RenderWidgetHostViewQt::GetCompositingSurface() on WindowsZoltan Arvai2014-01-131-0/+4
| | | | | | | | | gfx::GLSurfaceHandle needs reinterpret_cast for the first parameter to match an overload. Change-Id: I4b89c38b9694ab649e1e623049573675c926a4a7 Reviewed-by: Michael Bruning <michael.bruning@digia.com> Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Fix WebEngineContext on WindowsZoltan Arvai2014-01-131-0/+4
| | | | | | | | | | | | AppendSwitchASCII won't accept WChars, it would need WideToASCII conversion. But on OS_WIN AppendSwitchASCII method only wraps parameters for AppendSwitchNative with ASCIIToWide. Doing ASCIIToWide(WideToASCII()) not seems to be a useful idea, so we should call directly AppendSwitchNative on Windows. See chromium/base/command_line.cc. Change-Id: I9733993840ddaef2dbb3176135977c39a967e381 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Disable Werror by defaultPierre Rossi2014-01-111-0/+3
| | | | | | | | | We don't want everybody to have to go and tweak ~/.gyp/include.gypi just for that purpose. Change-Id: I67533a62246dea45c4b5a5a454f43d01328d472f Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix gpu::gles2::MailboxName on WindowsZoltan Arvai2014-01-111-1/+1
| | | | | | | | | | It is "struct GPU_EXPORT MailboxName" in chromium/gpu/command_buffer/service/mailbox_manager.h. MSVC won't accept class. Change-Id: I979808f357b32e1d99fe70a1138bf292b54c4e76 Reviewed-by: Andras Becsi <andras.becsi@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Fix overrides for WindowsZoltan Arvai2014-01-112-1/+6
| | | | | | | | | | Add not yet implemented overrides to render_widget_host_view_qt.h. Remove ambiguous and unneeded override from browser_context_qt.h. Change-Id: Id1cac9bf811d8e128e5ba8df059f7ca3bdd919dc Reviewed-by: Michael Bruning <michael.bruning@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix type conversion for WindowsZoltan Arvai2014-01-101-3/+11
| | | | | | | | | | MSVC uses WString instead of Utf16 so this needs different conversion in type_conversion.h. Change-Id: I987acb4ea5ad5a98c94fd992a9de05f602be825d Reviewed-by: Michael Bruning <michael.bruning@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix DownloadTargetHelper::determineDownloadTarget on WindowsZoltan Arvai2014-01-101-1/+1
| | | | | | | | | filePathForCallback.AddExtension won't accept const char[] with MSVC. It needs to be converted with the appropriate function. Change-Id: I95506de702eab4d7b61ddf051c7a122c793da35b Reviewed-by: Michael Bruning <michael.bruning@digia.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement WebEngineError class for handling ErrorDomainAdam Kallai2014-01-103-0/+154
| | | | | | Change-Id: I6092483d46b8d0db6193b92f2744bd836beb4912 Reviewed-by: Andras Becsi <andras.becsi@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Remove Q_UNUSED(uri) from webengine/plugin/plugin.cppAdam Kallai2014-01-081-1/+0
| | | | | | Change-Id: I403e7e3c89bd1881b96b1cc345ccdf115ceea5e9 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* createWindow QML API for QQuickWebEngineViewJocelyn Turcotte2013-12-233-3/+98
| | | | | | | | | | | | | | | | | | | | | | | | | 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 <pierre.rossi@gmail.com> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Make inspector listening port configurableXiaobo Wang2013-12-211-1/+14
| | | | | | | | | | | | Currently we use fixed port 1337 as inspector port. When weblauncher is launched by chromedriver it passes the inspector port as commandline argument --remote-debugging-port=<port>. Later on chromedriver will try to communicate with chrome via that port. We should use that port when starting devtools HTTP handler. Change-Id: I83e3341a535d50a129670bd0056b3ca448c8e2e5 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Fix the QQuickWebEngineView rendering with 1650.Jocelyn Turcotte2013-12-201-0/+12
| | | | | | | | | This is now initialized by Chromium in ContentMainRunnerImpl::Run, which we bypass for our browser process. Change-Id: Id8233df3fe12048cd2b6eaf870b161ab5d1eb089 Reviewed-by: Andras Becsi <andras.becsi@digia.com> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Adapt to chromium API changes in refs/branch-heads/1650Andras Becsi2013-12-207-14/+17
| | | | | | | This patch also updates src/3rparty to the new snapshot. Change-Id: I56da8d795051a828d7b375e57c4dda8bc570229f Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Avoid errors when closing the applicationJocelyn Turcotte2013-12-161-2/+9
| | | | | | | | | | This also fixes the crash on shutdown encountered when returning a TEXTURE_TRANSPORT GLSurfaceHandle from RenderWidgetHostViewQt::GetCompositingSurface. Change-Id: Ic92238907a3e7f9d0db4bf114269c1ca5cca5aa6 Reviewed-by: Arvid Nilsson <anilsson@blackberry.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix a crash when opening a window.Jocelyn Turcotte2013-12-161-1/+1
| | | | | | | | | | RenderWidgetHostViewQt::GetViewBounds gets called early than RenderWidgetHostViewQt::setAdapterClient when a new window is created by Chromium. Change-Id: I5ad61fc54ae773200403b222110a1d0ad541f941 Reviewed-by: Arvid Nilsson <anilsson@blackberry.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix the utility process launching.Jocelyn Turcotte2013-12-131-0/+2
| | | | | | | | | | | | | This would cause a crash of the render process while loading facebook.com since the utility process would try to use /proc/self/exe on linux. Bring back the kBrowserSubprocessPath switch to specify our subprocess executable. Change-Id: I4822d43f4a2b5ee86b941721da5ebb47d7a97c5d Reviewed-by: Arvid Nilsson <anilsson@blackberry.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix the build on ARMAndras Becsi2013-12-112-2/+2
| | | | | Change-Id: I5130a10d56cc7c25da0eabf51c3657ef58cebaa7 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Add ftp protocol handler.Xiao Zhang2013-12-104-17/+15
| | | | | Change-Id: Ib5ec11a23d609414f609969dbb2933d83eb6e3bd Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Introduce WebEngineLibraryInfo for providing pathsArvid Nilsson2013-12-095-35/+179
| | | | | | | | | This allows us to customize paths on BlackBerry, where QtWebEngine is currently installed to an different location than the rest of Qt5. Change-Id: I7144c992bed9fe4d7543ce0d23ee8cd5f5669dd9 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Minor clean-up in core_gyp_generator.pro and gyp_run.proAndras Becsi2013-12-092-4/+7
| | | | | | | | | | - Use QMAKE_RESOLVED_TARGET to find out the core lib target name - Pass the NINJAFLAGS env var to ninja instead of passing the content - Remove invalid dependency rule for the ninja target, which is only parsed because it looks like a qmake condition. Change-Id: I09bba8f350308d3249369171d0a3d5824f184590 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Add qrc protocol handler.Xiao Zhang2013-12-066-2/+346
| | | | | | | | | | Support qrc resources in html. For example: <script type="text/javascript" src="qrc:///xx.js"></script> <image src="qrc:///xx.png"></image> Change-Id: I490efb7cc300bf894659e79948b65729a12ad73d Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Use files for install instead of extraPierre Rossi2013-12-052-12/+7
| | | | | | | | | | We need to add the no_check_exist value in order for qmake to just accept that those files will eventually exist. This has the benefits of not messing with $(INSTALL_ROOT) and also stripping the library, which could prove useful. Change-Id: I43c230f185420ba92ff8e86f49b4e838ca5dd917 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Remove unused include_dirPierre Rossi2013-12-051-1/+0
| | | | | Change-Id: I4fabc860ad586755e28bd579df743822bcc2bf47 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Use QVector when creating argv for the command lineAndras Becsi2013-12-041-2/+4
| | | | | | | | MSVC does not support variable length arrays. Change-Id: I59ef844256eb1b2666331e5ed0411f63e36883ba Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Add Android specific build settings and command line switchesAndras Becsi2013-12-043-0/+22
| | | | | | | | Although this is an unsupported platfrom for QtWebEngine it is needed for Boot2Qt-Android and can live upstream. Change-Id: I21fea1fd00c1206e3b56373349b30df5ee121fda Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Quick: Add experimental.viewport.devicePixelRatioArvid Nilsson2013-12-0413-21/+157
| | | | | | | | | | | | | | | | | | | | 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/content_view_core_impl.cc. Change-Id: I1bc8878a47dabcdb6986c4fe5c8c4ac230ae2514 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Use the process we install to libexecPierre Rossi2013-12-032-13/+14
| | | | | | | | | Via QLibraryInfo. Also pick the name from qmake, and drop the hardcoded value. Add better error reporting when this fails. Change-Id: I44891a16f079b6c3c334f7f2bafa9edc0b4d69e4 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Get localized strings in the render processPierre Rossi2013-12-035-1/+53
| | | | | | | | Building on top of the repacking of .pak files, we now ship the whole array of repacked locales and pick the appropriate one at runtime. Change-Id: I0096e3eac6a1fc83885fd11e0fa55a746f8e45d8 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Ship repacked .pak filesPierre Rossi2013-12-0310-129/+77
| | | | | | | | | | | | | We used to wrap various .pak files in qrc files, but it turns out to be very memory inefficient compared to chromium's approach of mmaping those files. Drop the pak->qrc logic and instead add some pure gyp targets to repack the resources. We then install those with qmake and look them up with QLibraryInfo. Change-Id: I6dd3cedf6afa626ed181463911fef8885c9e9add Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Use ContentMainDelegateQt also for child processesPierre Rossi2013-12-035-51/+169
| | | | | | | | This will be necessary in order for the render process to load localized strings among other things. Change-Id: Ibb75e49f0bc583c158af61817e5b350f3534ec16 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement DidFailProvisionalLoad functionAdam Kallai2013-12-022-0/+7
| | | | | | | | | | | The WebContentObserver::DidFailLoad event doesn't handle all of the errors during the web content loading (eg. network errors). Thus WebContentObserver::DidFailProvisionalLoad should be binded on Qt side to handle these errors too. This event is handled by the WebContentsDelegateQt::DidFailLoad function now. Change-Id: I1421214dd94481a1e27cda8d35a35d418289b604 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix the build with a neon enabled setup to pass arm_neon=1 to gypAndras Becsi2013-12-021-1/+1
| | | | | | Change-Id: Ibe0bab32fb215bc4de58a474ca7b77a289dea2f0 Reviewed-by: Arvid Nilsson <anilsson@blackberry.com> Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Adding target specific options based on _target_name does not workAndras Becsi2013-12-021-9/+7
| | | | | | | | | | | Remove the condition for the defines and define them if we compile for the target. If these end up causing issues in the future we have will have to patch gl.gyp in chromium. Also move the TOOLKIT_QT define so that it is always defined. Change-Id: If80f057a277b22fd7e0c9b049eeb137b4876c4cb Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Moving sources to src part 2: Adjust paths.Jocelyn Turcotte2013-11-2815-93/+70
| | | | | | | | | | | | | | | | | | | NOTE: To build after this you should rerun init-repository.py or run $> git submodule sync $> git submodule update $> git config qtwebengine.chromiumsrcdir src/3rdparty This makes everything build by adjusting paths. Other mixed-in changes: - Rename qtwebengine_src variables in scripts to qtwebengine_root to avoid confusion. - Cleanup the release and debug extra targets that were in lib.pro. This file has also been split into src.pro and core.pro. Change-Id: Ieee9158a65f526b15244eaca59e779b7069d337e Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Moving sources to src part 1: Move files.Jocelyn Turcotte2013-11-2891-0/+11585
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/build.pro -> src/core/gyp_run.pro - 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 <zeno.albisser@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>