summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove the xPath argument from runJavaScriptJocelyn Turcotte2014-05-121-2/+2
| | | | | | | | | | | | | | This value is only used internally by Chromium and risks being removed at anytime, for which we would then have to maintain a downstream implementation. Chromium also only supports frame values, while a complete support of the interface would require also supporting this xPath to point to individual document element by affecting the value of "this", the same way that QWebElement::evaluateJavaScript allowed in QtWebKit. Change-Id: Id0cb1b8e3bdf9a6db0ca786fb5eb46ffd726d165 Reviewed-by: Michael Bruning <michael.bruning@digia.com>
* Add test_baseUrlAfterLoadHtml QML test caseSzabolcs David2014-05-081-1/+1
| | | | | | | | Remove unreachableUrl support from WebContentsAdapter::setContent, because this argument behaves exactly the same as baseUrl. Change-Id: I36f92b99b7045c6d3b831481bb04d51a0e05772f Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Add WebRTC supportPierre Rossi2014-04-291-0/+1
| | | | | | | | | | | | | Reuse the MediaCaptureDevicesDispatcher from the chrome layer, pretty much as is, and wire it in with WebContentsDelegateQt and WebContentsAdapter/WebContentsAdapterClient for API delegation. We also need to ensure that our user agent string mentions Chrome and the Chrome version we're based on, in order to please websites that detect feature support that way. Change-Id: I0ddf8cd34e4add96bc36f59adfe8e0384e728d93 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Get rid of the BackingStore rendering pathJocelyn Turcotte2014-04-081-2/+2
| | | | | | | | | Now that the widgets view is also using the delegated renderer, there are no supported configuration that use the BackingStore rendering path, itself on the way of deprecation in Chromium. Change-Id: I4ab889f6a7c65e8447c259faf2c7a98b88c1acf5 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Revert part of the RenderWidgetHostViewQtDelegate refactoringJocelyn Turcotte2014-04-081-0/+1
| | | | | | | | | | | This reverts parts of commit 9c198939be1ef064d1a2430a4b9991f2fe16f359. This does keeps the popup fixes and removes support for QWebEnginePage::setViewportSize and QWebEnginePage::render until we can evaluate the needs vs the cost of such feature. Change-Id: I1b55b751d463717b1462393ea8cd353422f8fdbb Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Implement QWebEngineHistoryItem::lastVisitedJocelyn Turcotte2014-03-311-0/+1
| | | | | | Change-Id: I105cb2a0a2479b146e2ab68db6d194ac2ac2d3f9 Reviewed-by: Andras Becsi <andras.becsi@digia.com> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Implement QWebEngineHistory serializationJocelyn Turcotte2014-03-311-0/+2
| | | | | | | | | | | | | | This does uses logic taken from Chromium's state save and restore code. The history version is incremented from the same method in QtWebKit in cases where the application would try loading a stream from a previous version using QtWebKit. In all cases where Chromium does a restore of a serialized history, it does so on a fresh WebContents instance, thus we must do the same and some of the initialization code has to be updated. Change-Id: I45abb052073bd44c9cb47bc2abcf4b558fe3dbbd Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Implement basic editing actions for QWebEnginePageJocelyn Turcotte2014-02-201-0/+8
| | | | | Change-Id: I1b58d2b2e86f60e296ae48095ed8d5e8172e0d1e Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Implement QWebEnginePage::findTextJocelyn Turcotte2014-02-131-0/+2
| | | | | | | | | | | | | | | | | | | 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-131-0/+1
| | | | | Change-Id: Idebde8da0befbea7ccc5942de1e09fcc61ce16d4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Implement QWebEnginePage::requestedUrlJocelyn Turcotte2014-02-121-0/+1
| | | | | Change-Id: I6accd8fd40ad72041770439aa6a7aa59ba904418 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Fix tst_QWebEngineFrame::baseUrlJocelyn Turcotte2014-02-121-1/+1
| | | | | | | | | | | 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-121-1/+0
| | | | | | | | | | | | | | | 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>
* Implement loadHtml function for QQuickWebEngineViewSzabolcs David2014-02-111-1/+1
| | | | | | | | Implement unreachableUrl support for WebContentsAdapter::setContent and add loadProgressAfterLoadHtml QML test case. Change-Id: I2d0d7834cbbf8f508de4fa9cb72240f2ac6ebf83 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Quick: Support reparentingArvid Nilsson2014-01-311-0/+3
| | | | | | | | | | | | | | | | | 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>
* 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 <pierre.rossi@gmail.com>
* Refactor the callback mechanism used by runJavaScriptJocelyn Turcotte2014-01-221-7/+2
| | | | | | | | | | | | | | | | | | 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-221-0/+1
| | | | | | | | | | 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-171-0/+1
| | | | | | | | 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>
* [Widgets] wire the file pickersPierre Rossi2014-01-151-0/+1
| | | | | | | | | | | | | | | 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>
* Quick: Add experimental.viewport.devicePixelRatioArvid Nilsson2013-12-041-0/+2
| | | | | | | | | | | | | | | | | | | | 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 1: Move files.Jocelyn Turcotte2013-11-281-0/+97
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>