summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets
Commit message (Collapse)AuthorAgeFilesLines
* Implement QWebEnginePage::viewportSizeJocelyn Turcotte2014-02-216-10/+24
| | | | | | | | | | Keep the size in the page itself, and ask the optionally attached QWebEngineView only for the rect position. When the view size change, call setViewportSize on the page like QtWebKit does. Change-Id: I735f1509cab9ef9b5d32bf31249a59c919939804 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix a crash when using the history on an adopted pageJocelyn Turcotte2014-02-201-0/+1
| | | | | | | | We also need to update the WebContentsAdapter pointer in QWebEngineHistoryPrivate. Change-Id: I8251e9834b179747b6b65630cf4ced5c2b1af27f Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement basic editing actions for QWebEnginePageJocelyn Turcotte2014-02-201-1/+43
| | | | | Change-Id: I1b58d2b2e86f60e296ae48095ed8d5e8172e0d1e Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Add project's directory to includepath on WindowsZoltan Arvai2014-02-191-1/+1
| | | | | | | | | Unlike other OSes, project's directory is not included by default to includepath on Windows. This would cause missing file errors while building. Change-Id: I64b83e13adaae1ee1730caebcf7442973b573c3b Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement QWebEnginePage::findTextJocelyn Turcotte2014-02-135-6/+59
| | | | | | | | | | | | | | | | | | | A few changes to the API: - Return the success result asynchronously. - FindWrapsAroundDocument and HighlightAllOccurrences are enabled by defaults and cannot be disabled. - Found text isn't updating the selection on the page like QtWebKit did, but triggers a separate state not available. A find count and current index could be exposed, but isn't in this case to keep the API delta lower. This also adds the possibility to pass bool results through the CallbackDirectory and add a new tst_QWebEnginePage::findTextResult test since the old test relied on the selection to be updated when the searched text is found. Change-Id: I8189b5aea8d832df183c6c1ae03e3f08198a9c45 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Implement QWebEnginePage::selectedTextJocelyn Turcotte2014-02-133-0/+29
| | | | | Change-Id: Idebde8da0befbea7ccc5942de1e09fcc61ce16d4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Refactor the way callbacks are storedJocelyn Turcotte2014-02-132-22/+120
| | | | | | | | | | | | | | | | With the upcoming addition of a new type of callback result, this patch allows storing multiple callback types in the same QHash instead or requiring a different hash table just to please the type system. This does so by managing the ref-counted callback pointers directly instead of relying on a templated QExplicitlySharedDataPointer that requires a different type for each different callback pointer type. The ref-counting, construction and destruction is managed through a run-time type enum. Change-Id: I90ab2e1efc0c9703fc5b6ef57b38204ac8eea828 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the requestID argument before the resultJocelyn Turcotte2014-02-132-6/+6
| | | | | | | | | | This tries to get the order of declaration to be consistent. It also follows the order used by Chromium in some places where the routing_id usually comes first, then the request_id and then the result of the asynchronous request. Change-Id: I88e164dee67e1631161a222f7dd7a4679c3d3acd Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix a warning in QWebEnginePage::setHtmlJocelyn Turcotte2014-02-131-1/+0
| | | | | Change-Id: I87c18edb89658433d6dc3487ab92d2ff7bd6c986 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Cleanup on webenginewidgets.proZoltan Arvai2014-02-131-6/+0
| | | | | | | Remove unneeded parts that handled by load(qt_module) already. Change-Id: I50646d754d1eec96342ba2f7c45f1a023a7257ae Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Fix QNetworkRequest usage in WebEngineWidgets on WindowsZoltan Arvai2014-02-132-2/+2
| | | | | | | | | Changing unused variable suppression in acceptNavigationRequest is required for MSVC otherwise it fail with undefined type error. Also adding more suppression for unused wariable warning. Change-Id: Ic449973bc8166f18655e40bf57041b8f02869266 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Make QWebEnginePage support symetrical url and setUrlJocelyn Turcotte2014-02-122-1/+7
| | | | | | | | Unlike load, the value passed to setUrl should be returned by url until the url is updated by the page (load finished or url changed). Change-Id: Ica80941754fcf57d68071123daa28f5ddd1359fe Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Implement QWebEnginePage::requestedUrlJocelyn Turcotte2014-02-121-0/+6
| | | | | Change-Id: I6accd8fd40ad72041770439aa6a7aa59ba904418 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Fix tst_QWebEngineFrame::baseUrlJocelyn Turcotte2014-02-122-4/+2
| | | | | | | | | | | Update tests to check that we can keep the same functionality by querying document.baseURI through runJavaScript instead of implementing QWebEnginePage::baseUrl. This also removes QWebEnginePage::baseUrl from the header. Change-Id: I549e57d3986e22986438f8a23e469bbd220633b7 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* [Widgets] RenderWidgetHostViewQtDelegate refactoringPierre Rossi2014-02-1210-70/+393
| | | | | | | | | | | | | | | Break up the delegate implementation into two distinct subclasses. The first one offers a way for the WebPage to tap into the RenderWidgetHostView directly, while a different implementation that is backed by a top-level widget can be used to show WebUI popups on screen. This has the benefit of not having a child widget in the webview among other things. It also fixes our popups and allows them to fall outside the window frame. Change-Id: I80dc1e4f21bb91ff47c75a626d330f88eacce8c6 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Fix WebEngineWidgets api build on WindowsZoltan Arvai2014-02-111-0/+8
| | | | | | | | MSVC doesn't know __func__ so it needs to be defined. Also eliminate some unused variable warning. Change-Id: Ia42e411c0af8425a71faf99a87dbc0affac53015 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement requestFullscreen for QQuickWebEngineView.Zeno Albisser2014-02-111-0/+2
| | | | | | | | | | | | | | 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 <jocelyn.turcotte@digia.com>
* Add TakeFocus in WebContentsViewQt for passing on tab focus.Zeno Albisser2014-02-101-0/+2
| | | | | | | | | | 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 <andras.becsi@digia.com>
* Fix the embedded buildAndras Becsi2014-02-051-3/+4
| | | | | | | | | | Adopt to toolchain changes and fix the build with the current snapshot. This patch adds some missing overrides and build system configurations. Change-Id: I488929500347bdb5a077ac14e9553cedfcaa605d Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Quick: Support reparentingArvid Nilsson2014-01-312-7/+6
| | | | | | | | | | | | | | | | | 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 <jocelyn.turcotte@digia.com>
* WebPage: Implement javaScriptConsoleMessagePierre Rossi2014-01-303-1/+16
| | | | | | | And unskip the corresponding autotest. Change-Id: Ida2dcee38b261b2ba4ad0c5c016f5510ed1590a4 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Clear callbacks with an empty value on page destructionJocelyn Turcotte2014-01-221-3/+15
| | | | | | | | | | | | | | | The current implementation offers no way to cancel async requests. This means that normal applications could easily allow callbacks to dereference a destroyed object unless they use a smart pointer within the callback function object. This patch will empty the pending callback list by calling each of them with an empty value. This will at least allow applications to cover the cases where the page is expected to have a shorter or equal lifetime than objects referenced in the callback. Change-Id: Ia9fc556b03f5d83f904a0ff4b05dc9e440ea488c Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Implement QWebEnginePage::toHtml and toPlainTextJocelyn Turcotte2014-01-223-2/+30
| | | | | | | | | | | | | | | | 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>
* Refactor the callback mechanism used by runJavaScriptJocelyn Turcotte2014-01-223-32/+37
| | | | | | | | | | | | | | | | | | 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-222-0/+22
| | | | | | | | | | 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-173-3/+13
| | | | | | | | 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>
* JS dialogs in QtQuickPierre Rossi2014-01-152-9/+21
| | | | | | | | | | 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>
* [Widgets] wire the file pickersPierre Rossi2014-01-153-13/+51
| | | | | | | | | | | | | | | 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>
* Implement QQuickWebEngineLoadRequest classAdam Kallai2014-01-152-2/+4
| | | | | | | | 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>
* Quick: Add experimental.viewport.devicePixelRatioArvid Nilsson2013-12-042-0/+6
| | | | | | | | | | | | | | | | | | | | 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>
* Moving sources to src part 2: Adjust paths.Jocelyn Turcotte2013-11-281-9/+9
| | | | | | | | | | | | | | | | | | | 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-2817-0/+2752
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>