summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove the xPath argument from runJavaScriptJocelyn Turcotte2014-05-121-4/+6
| | | | | | | | | | | | | | 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-2/+2
| | | | | | | | 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/+7
| | | | | | | | | | | | | 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-7/+7
| | | | | | | | | 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/+7
| | | | | | | | | | | 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/+7
| | | | | | 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-8/+164
| | | | | | | | | | | | | | 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>
* Adapt to API changes in new stable branch 1750Andras Becsi2014-03-281-5/+4
| | | | | | Change-Id: If0cc263f36d396fd505c1d8b026e2493bfc29cc4 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Keep the selection when done searching to match Chromium's behaviorJocelyn Turcotte2014-02-211-1/+1
| | | | | | | | | This basically transforms the "search selection" into normal selected text when findText(QString()) is called and allow pressing enter to trigger links, etc. Change-Id: I590dfddef174d3ebf2f36453b5f44e692bf5f827 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement basic editing actions for QWebEnginePageJocelyn Turcotte2014-02-201-0/+42
| | | | | Change-Id: I1b58d2b2e86f60e296ae48095ed8d5e8172e0d1e Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Fix title getter in WebContentsAdapterPierre Rossi2014-02-131-2/+1
| | | | | | | | Using GetTitle directly seems more reliable than going through the navigation controller. Change-Id: I0529a92295de063c6cea3371cdb9c44602950e9a Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement QWebEnginePage::findTextJocelyn Turcotte2014-02-131-0/+25
| | | | | | | | | | | | | | | | | | | 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/+6
| | | | | Change-Id: Idebde8da0befbea7ccc5942de1e09fcc61ce16d4 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Move the requestID argument before the resultJocelyn Turcotte2014-02-131-1/+1
| | | | | | | | | | 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>
* Implement QWebEnginePage::requestedUrlJocelyn Turcotte2014-02-121-0/+11
| | | | | Change-Id: I6accd8fd40ad72041770439aa6a7aa59ba904418 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Fix resizing not working on new windowsJocelyn Turcotte2014-02-121-1/+2
| | | | | | | | | | | | | | | We have to re-run initialize on attached WebContentsAdapter to update the client. We currently however initialize the renderer inconditionally at the end if the initialization, which in this case would create an extra RenderWidgetHostView and keep the old one in limbo. Fix the issue by checking if the WebContents already has a live view before forcing the creation of a new one. Change-Id: Icfdbde016f9a49bfad643286881a6e409c958e94 Reviewed-by: Andras Becsi <andras.becsi@digia.com> Reviewed-by: Adam Kallai <kadam@inf.u-szeged.hu>
* [Widgets] RenderWidgetHostViewQtDelegate refactoringPierre Rossi2014-02-121-7/+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/+3
| | | | | | | | Implement unreachableUrl support for WebContentsAdapter::setContent and add loadProgressAfterLoadHtml QML test case. Change-Id: I2d0d7834cbbf8f508de4fa9cb72240f2ac6ebf83 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Move the implementation of BrowserContextQt to its own cpp fileAndras Becsi2014-02-051-0/+1
| | | | | Change-Id: Ie44a8733e3f9123c3d086f8df9ddcf2833bd235b Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Quick: Support reparentingArvid Nilsson2014-01-311-0/+12
| | | | | | | | | | | | | | | | | 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>
* Pre-start the render process upon initialiazing the adapterPierre Rossi2014-01-281-1/+7
| | | | | | | | | | | | | | | 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 <jocelyn.turcotte@digia.com> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Add loadUrl QML test with stopStatus test case.Szabolcs David2014-01-281-0/+1
| | | | | | | Fix the webEngineView.stop() function in the WebContentsAdapter. Change-Id: I82c5000fb3cbc5aff59dd0c4c7c86ca7755a6329 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement QWebEnginePage::toHtml and toPlainTextJocelyn Turcotte2014-01-221-0/+14
| | | | | | | | | | | | | | | | 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-221-1/+4
| | | | | | | | | | | | | | | | | 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-221-10/+16
| | | | | | | | | | | | | | | | | | 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/+16
| | | | | | | | | | 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/+7
| | | | | | | | 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-151-1/+2
| | | | | | | | | | 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-151-0/+27
| | | | | | | | | | | | | | | 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/+11
| | | | | | | | | | | | | | | | | | | | 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/+346
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>