summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement multiple mouse click detection.Michael Brüning2013-09-163-16/+40
| | | | | | | | | | Fixes the ASSERT we were seeing on double clicks and implements detection for triple, quadruple etc. clicks. Double mouse clicks forwarded from QMouseEvent are swallowed. Change-Id: I9be83f809805ab3dea7a508b648046238ce36a90 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Use toFilePathString for download file names.Michael Brüning2013-09-121-10/+9
| | | | | | | | | Use the appropriate method to convert to base::FilePath::StringType. Also removes unused and unneeded variables. Change-Id: I6005e0e9b566a8bb4182005571a68d5b9da9b409 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Implement sizeHint for widgets API.Michael Brüning2013-09-121-0/+2
| | | | | | | Unconditionally return a 800 by 600 like in QtWebKit. Change-Id: I6ae151d535fb35ad3420f17921be73ba55878945 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* WebContentsDelegateQt: Remove WebContents memberPierre Rossi2013-09-052-4/+2
| | | | | | | This is not needed anymore since the ownership changed Change-Id: I7bfbb51c79a0d48ca8197a9b3a5d18986ee40e36 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Add implementation to enable downloads.Michael Brüning2013-09-032-6/+128
| | | | | | | | | | | | | | | | | This implementation will download files to the standard download directory and assign unique file names should there be a file with the same name existing or being downloaded. It should be replaced with some more sophisticated code that also takes into account settings and user choice possibly. For now, it is only added to make downloads work at all. Known issue: We do not get notified about completed downloads even though we are observing the DownloadItem objects. Change-Id: I2b52246635d3fd1358edc6b648d470ff821bc9f1 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Fix rendering on Retina displaysAndras Becsi2013-09-028-14/+59
| | | | | | | | | | Since the QWindow returned by the RWHV delegates was always 0 we never actually propagated a valid WebScreenInfo to chromium. Additionally the painting and scrolling in the backing store had to be fixed so that the device pixel ratio is taken into account. Change-Id: I22dc135e8e090362201292863ed911464b9fc133 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Implement window creation through QWebEnginePage::createWindow.Jocelyn Turcotte2013-09-0216-33/+172
| | | | | | | | | | | | | | | | | | | | | | | | | This makes the necessary changes to handle WebContentsDelegateQt::AddNewContents and funnel the callback through createWindow in QWebEnginePage and QWebEngineView. - Expose the AddNewContents callback through WebContentsAdapterClient - Allow creating a WebContentsAdapter attached only on the Chromium side, leaving the choice to QWebEnginePage to either adopt it and call WebContentsAdapter::initialize to attach itself as the client, or destroy it if the application isn't handling the call. - Delay the InitAsChild handling in RenderWidgetHostViewQt when it is called before an adapter client has been attached. - Since WebContentsAdapterClient::CreateRenderWidgetHostViewQtDelegate is only a factory method, not creating any link with the callee client, allow using the creating window's adapter client to create the RWHVQtDelegate. This allows an unparented delegate to be created instead of needing to add numerous null-checks in RWHVQt. Use content::WebContents::CreateParams::context for this purpose, which can be used both when creating a WebContents ourselves and when a new window's WebContents is created for us. Change-Id: I032262e867931dc40a7c2eca0c993027a555f56e Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Make less noise with QT_WEBENGINE_LOGGINGAndras Becsi2013-08-301-5/+5
| | | | | | | | | Comment out QT_NOT_YET_IMPLEMENTED in MovePluginWindows and SetTooltipText since they make too much noise and hide every other message. Add missing macro where it might be useful. Change-Id: I6a5b7bb677cfa5e74521a06955338552a6b011f0 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Ref-count WebContentsAdapter.Jocelyn Turcotte2013-08-293-5/+7
| | | | | | | | | | This is needed to handle createWindow where a WebContentsAdapter will be created to wrap the new WebContents and will passed up through the API. If the application doesn't handle the callback, this will allow managing the lifetime of the WebContents more easily. Change-Id: I40ae1973a9bdf8c3d75f9ff137228d48ed92cfb2 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Get rid of WebContentsAdapter::webContents().Jocelyn Turcotte2013-08-292-30/+38
| | | | | | | This isn't needed since the ownership was removed from WebContentsDelegateQt. Change-Id: I44755966fd7681c638da083803cfde6262cb2dc2 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Let WebContentsAdapter own the WebContents directly.Jocelyn Turcotte2013-08-293-55/+40
| | | | | | | | | | Flatten the ownership tree by removing WebContentsDelegateQt from the ownership chain of the content::WebContents. This also let WebContentsAdapter do the needed initialization work. Change-Id: Ie652bbcad54799b66d28a4a33e627f667b1c0d28 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix Tab to switch focus instead of inserting \t.Jocelyn Turcotte2013-08-211-0/+1
| | | | | | | | | Blink uses the WebKeyboardEvent::keyIdentifier string to detect Tab key presses. Make sure that we properly populate this field before forwarding the event. Change-Id: I7da52b5678cfc1bd7f433d9cc9cd4531e6a24728 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Fix the build.Jocelyn Turcotte2013-08-201-0/+1
| | | | | Change-Id: I0d6257d967413de93665e6bd3f06cb49d9e0607a Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement the basic parts of QWebEngineHistory.Jocelyn Turcotte2013-08-208-11/+300
| | | | | | | | | | | | | | Mark the remaining methods as not implemented to allow enabling most of the dependent code in the demo browser and in API tests. Add two new tests to cover cases that might be problematic with the index-based implementation. This also renames WebContentsAdapter::navigateHistory to navigateToOffset in order to avoid confusion with navigateToIndex. Change-Id: I7c5cb9f5f878e34206fdfe48334a2dc7d9d95a1d Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Use the WebContentsAdapter directly in QWebEngineHistory.Jocelyn Turcotte2013-08-204-16/+11
| | | | | | Change-Id: Iac80388e8d3a789b336ab88b75c6fa6048a3c446 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement QWebEnginePage::action for basic navigation.Jocelyn Turcotte2013-08-204-43/+149
| | | | | | | | This imports code from qwebpage.cpp and QWebPageAdapter.cpp of WebKit into qwebenginepage.cpp and thus also restrict the license accordingly. Change-Id: Ic5da8f2b469109cb10132cbe6585f2d941b14403 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Centralize type conversion functions.Jocelyn Turcotte2013-08-207-19/+84
| | | | | | | | | | | | | This adds the common GURL->QUrl and string16->QString conversions into a common header and use those functions throughout the code. Move the qStringToStringType into the same header and rename it to a name consistent with the others. This also cleans up shared_globals.h by moving content:: forward declarations in the cpp, where they are used. Change-Id: I19527ea7de1f6047aae8b44c97eb4d7c3e5a0e54 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Let the application sanitize the URL.Jocelyn Turcotte2013-08-201-2/+0
| | | | | | | | | | Do like the QtQuick example and let the Widgets example use urlFromUserInput to add a missing http scheme instead of letting QtWebEngine do it. This is the same behavior as QtWebKit does. Change-Id: Iac1570523253126e059afb00c3a2ff844e177ff1 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement QWebEngineView/Page::url/setUrl.Jocelyn Turcotte2013-08-202-0/+21
| | | | | | Change-Id: I8b188fb1c6167612307d4db3272f5ae6f85705c7 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Implement QWebEngineView::title and QWebEnginePage::title.Jocelyn Turcotte2013-08-202-5/+16
| | | | | Change-Id: I9fb191a5a2351c5c953f640a6cf1a33609385cc9 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Move the WebContentsAdapter to QWebEnginePage.Jocelyn Turcotte2013-08-208-88/+116
| | | | | | | | To allow QWebEnginePage to act on its own, let it own the WebContentsAdapter and let the view delegate its calls through the page. Change-Id: I851c753d068992e387edab0e1ea8018732af1fd7 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Merge QWebEngineFrame into QWebEnginePage.Jocelyn Turcotte2013-08-202-219/+157
| | | | | | | | | | Chromium doesn't allow managing sub-frames from the contents API. To support operations that were made on the main frame, merge the frame API into the page. Methods should be later either be removed or implemented one by one. Change-Id: I52de89a48c00efb9dd0cf0a2c1fdf09d735d2381 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Import QtWebKit public headers.Jocelyn Turcotte2013-08-2015-63/+1462
| | | | | | | | | | | | | | | | | | | This is the first step toward re-implementing part of the QWebView API on top of QtWebEngine. The plan is to import the complete headers to facilitate diffs and progress tracking. Changes squashed in this commit: - Use the QWebEngine prefix for class names - Strip out non-public members and directives - Allow building using those headers by disabling the Q_PROPERTY macros and by adding a dummy implementation for virtual methods directly in the header - Update the widgetsnanobrowser example to comply with the slight changes from the previous API Change-Id: Ia7efa5430f775d09b493544430a04856cc7928f6 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Use QObject::d_ptr for public API classesJocelyn Turcotte2013-08-208-21/+18
| | | | | | | | | | | This follows the model used by the rest of Qt, potentially avoiding binary compatibility issues. The compromise is that we now depend on core-private, thus forcing us to follow Qt's release cycle. Change-Id: Ib2df51071fc35935ac99edf7b9c5562949cb43e2 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Change "Contents" to "Engine" in API class names.Jocelyn Turcotte2013-08-1911-120/+120
| | | | | Change-Id: I58d83f4f33728f92e4bf13b6be30b15528fdd033 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Add implementation for pure virtual functions after updating Chromium.Zeno Albisser2013-08-171-0/+3
| | | | | Change-Id: Id760a1b39b5f9efeea49e49183b1fcc68fd54f8f Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Move QWEBENGINEWIDGETS_EXPORT to qtwebkitwidgetsglobal.hJocelyn Turcotte2013-08-134-7/+58
| | | | | | | | Since the macro is used in public headers, it should also be declared in one of the webenginewidgets module's public headers. Change-Id: I5cd56196e95c78fac2ba8df076f2cd683b01a5ac Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Once created, keep the WebEngineContext until shutdown.Jocelyn Turcotte2013-08-121-15/+4
| | | | | | | | | Chromium isn't expecting the destruction and reconstruction of the ContentMainRunner and BrowserMainRunner. This will need a few tweaks before we can do this without hitting asserts in debug builds. Change-Id: I0c46a2db27350b3f6352e3eb8a5ec7ecff06784e Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Delete the ResourceContextQt on the IO thread.Jocelyn Turcotte2013-08-121-1/+6
| | | | | | | This mimicks the Shell's behavior to avoid an assert. Change-Id: I31fdb4ff9c1ee9a359db84978da313489e93e30a Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Fix the segfault on exit.Jocelyn Turcotte2013-08-122-11/+17
| | | | | | | | | | | | The WebEngineContext member was declared after the WebContentsDelegateQt in WebContentsAdapter. This means that the delegate was destroyed after the context and would cause the crash. Reorder the declaration and move the WebContentsDelegateQt also to the private class to reduce future confusion. Change-Id: I343504d4fd1ede80feb710446368fdf12f360b15 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Delay the RWHVDelegate parenting until it's been attached to its RWHV.Jocelyn Turcotte2013-08-1212-11/+32
| | | | | | | | This avoids the RWHV being accessed before being attached to the delegate when attaching the later to the view's layout. Change-Id: I5fffef60fdd7203cfb4ced807b5475aac676ea09 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Simplify the ownership between RWHVQt and RWHVQtDelegate.Jocelyn Turcotte2013-08-124-9/+10
| | | | | | | | | | Let the RWHVQt explicitly own its delegate. Keep the same behavior by letting RWHVQt::Destroy delete itself directly like done in RWHVGtk instead of deleting the RWHVDelegate which would then delete its RWHV. Change-Id: I051c95d608964ebcd66d3ccbe728f63c0ca397ae Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Avoid keeping a RWHVDelegate pointer in WebContentsViewQt.Jocelyn Turcotte2013-08-127-5/+19
| | | | | | | | | There can be multiple RWHVDelegates within one WebContentsViewQt during navigation. Avoid keeping a pointer by sending the focus call to the client directly, which fits the purpose better. Change-Id: I863c174e9a2567f3580f3cb525bc5353ab2a4417 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Add a dummy implementation of DownloadManagerDelegate.Michael Brüning2013-08-084-2/+237
| | | | | | | | Prevents the the web engine from crashing by providing an implementation and generating download Ids for downloads. Change-Id: Iac1e98b74ec1fdc9d913951fbfed4b7ba394170f Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Fix some style inconsistencies in the header file.Michael Brüning2013-08-0710-25/+25
| | | | | | | Changed the header #defines to UPPERCASE_CLASS_NAME_H. Change-Id: I49dec91d7a97808c1b9618df6d985939fd84babb Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Remove ASSERT from forwardEvent.Michael Brüning2013-08-021-1/+0
| | | | | | | | | | | | This was causing trouble when QEvents were forwarded from the RenderWidgetHostViewDelegateQtWidget event handler method before the RenderWidgetHostView had been initialised. forwardEvent checks for a pointer to the view being set anyway, so the ASSERT does more harm than good. Change-Id: I59035d2fc053054400f85b3b9c2b8ad065f22627 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Implement more detailed load information handling.Michael Brüning2013-08-027-2/+36
| | | | | | | | | | | | Add WebContentsObserver as a base class of WebContentsDelegateQt to be able to get more information about the WebContents (loading state etc.). Also implements load finished with a success value to be able to show when a load has failed. Change-Id: Ic2ad698d180b395cf3d9fb6cd49b12c9cb4fb493 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Don't pass the RWHV to the AdapterClientPierre Rossi2013-08-0213-21/+39
| | | | | | | | | | | | | As this looks like a layering violation. Instead, rely on WebContentsViewImpl::CreateRenderViewForRenderManager querying the WebContentsView's size before setting it on the RenderWidgetHostView. The WebContentsView now gets the size of the actual view through the Adapter interface. Then, in RenderWidgetHostViewQt, we now forward the resize request to the delegate. Change-Id: Ide679f6d114508cc7c9ffac83daad19d16764a4d Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Handle basic cursor changes.Jocelyn Turcotte2013-08-016-2/+110
| | | | | Change-Id: Ic08f83db03454542554fac9e590d79a4440a4b28 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Forward mouse hover events to the page.Jocelyn Turcotte2013-08-017-1/+42
| | | | | Change-Id: I5ce13af04de8520bb0ab93c48a2493822aa42294 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Use ui::GestureRecognizer to enable viewport gestures.Jocelyn Turcotte2013-08-012-2/+93
| | | | | | | | | | | | This enables panning and zooming using touch events. Also map touch IDs given by Qt to 0-based IDs since the gesture recognizer expects it. It currently needs the following command line switches to be enabled: --force-compositing-mode --enable-threaded-compositing --enable-pinch Change-Id: I34db3203529470aef5426ddfaa65af7d67e4b017 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Transform QTouchEvent into ui::TouchEvent first.Jocelyn Turcotte2013-08-014-47/+63
| | | | | | | | | | | | | | | WebTouchEvents have a slightly different behavior than QTouchEvent in that the type of the event is TouchStart for each new point press, while Qt sends a TouchBegin only for the first point press. Since we already need to use ui::TouchEvent to be able to use ui::GestureRecognizer, always do this conversion first to also let UpdateWebTouchEventAfterDispatch chose the proper event type. Some of the code from render_widget_host_view_aura.cc was copied into render_widget_host_view_qt.cpp to fill the needed functionality. Change-Id: Iab1ca0c449b5256a39b5479ce89b662d4e133935 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Enable accelerated composition with QtWidgets view for testing.Jocelyn Turcotte2013-08-015-7/+32
| | | | | | | | | | Only enable it when the --force-compositing-mode switch is used. The purpose of this is only to allow testing pinch-zooming until we are able to use the delegated renderer in the QtQuick view. Change-Id: I2ca265c84c8fe6a74299f1b2757ad525f33fae17 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com> Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Split out the Widgets and QtQuick integrationPierre Rossi2013-07-3128-269/+769
| | | | | | | | | | | | | | | This is the first step to making proper Qt Modules out of QtWebEngine. The Widgets integration becomes a proper C++ Qt Module while we make the QtQuick side a QML plugin for now (could probably be promoted if the need arises). Code-wise, this means the introduction of a WebContentsAdapterClient interface that is subclassed by the private implementation of our API classes for delegation of things that are UI specific. Functionality from WebContents and the like is exposed via the WebContentsAdapter. Change-Id: I4ca3395b9fe8502a24e36002cfd5af44067bb6e8 Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
* Forward touch events.Jocelyn Turcotte2013-07-297-3/+67
| | | | | | | This lets the page receive touch events sent to the QWidget/QQuickItem. Change-Id: Ic358d4963d6af3df57d37a02b471cd442e8947ce Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix the GPU process launch.Jocelyn Turcotte2013-07-291-0/+1
| | | | | | | | base::FILE_EXE isn't used by this process and we therefore also need to set the kBrowserSubprocessPath switch. Change-Id: I5a5e721c765cc1990d155f6c6d9ac1b442dc44b0 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix the debug build.Jocelyn Turcotte2013-07-292-164/+0
| | | | | | | | | Move resource_bundle_qt.cpp to the shared lib since the process also needs its symbols. The qrc file should normally follow, but Windows doesn't support them in static files, so keep them separated until it's a problem. Change-Id: I4963e4609592df90126f8b8a18a4d368907f205f Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Remove erroneous Q_DECL_OVERRIDE from non-virtual functionAndras Becsi2013-07-291-1/+1
| | | | | | | Build fix when using a C++11 enabled compiler. Change-Id: I516b96459fae050b95fd944814d8d497add06f72 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Use command line switch identifiers instead of string constants.Jocelyn Turcotte2013-07-291-9/+6
| | | | | Change-Id: I36007b0c0fbf194df1941e72ae2a93adf5ed6d0b Reviewed-by: Andras Becsi <andras.becsi@digia.com>
* Fix the indentation of browser_context_qt.hAndras Becsi2013-07-261-67/+67
| | | | | | | This is a whitespace-only change. Change-Id: I50ac5879f13c32b2603da45fb110b00b6f9c57db Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>