summaryrefslogtreecommitdiffstats
path: root/lib/web_contents_view_qt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Delegated renderer: enable by default for QQuickWebView.Jocelyn Turcotte2013-11-151-7/+2
| | | | | | | | | | | This also allows the software code path to be enabled: - Programmatically by setting this dynamic property on the QCoreApplication: "QQuickWebEngineView_DisableHardwareAcceleration" - Through the Chromium command line switch "--disable-delegated-renderer" for quick development use cases. Change-Id: I32136d880444e0a24f042c7c4862950b7ed0c910 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Remove the native window hardware acceleration support for widgets.Jocelyn Turcotte2013-11-131-2/+0
| | | | | | | | This experiment served its purpose and is now more often broken than useful. Change-Id: I73ea68c99dedcc8a3fe9004d130518daf146b493 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Make RenderWidgetHostViewQtDelegate a pure interface.Jocelyn Turcotte2013-11-061-2/+1
| | | | | | | | | | | | | | | | | | | | | | | RenderWidgetHostViewQtDelegate acts as a bidirectional interface to avoid exporting Chromium symbols outside of the core dynamic library. The problem is that, other than this, from the top layer point of view, its responsibilities are the same as RenderWidgetHostViewQt, and it would be better not to split its logic without properly defined responsibilities. Using it as a base class and interfacing through its protected methods is also cumbersome and make the destination of calls on the upper layer difficult to discern. Use instead a dual pure interface mechanism like WebContentsAdapter and pass the callback client interface directly in WebContentsAdapterClient::CreateRenderWidgetHostViewQtDelegate. This allows RenderWidgetHostViewQtDelegate to be solely what it should be, an interface. Change-Id: I4e55439ae7f9539cc9e360f0756fbf391405f3b7 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Implement popup dialogMary Wu2013-10-291-3/+10
| | | | | | | | | This is used to show like date time picker whose document content was generated in webkit engine. Change-Id: I900a6ae5f61646d2ef8497dccc114f7cb5882349 Reviewed-by: Michael Bruning <michael.bruning@digia.com> Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Render delegated renderer frames using the Qt scene graph.Jocelyn Turcotte2013-10-141-1/+3
| | | | | | | | | | | | | | This provides a stub implementation that renders quads and RenderPasses using QSGNodes in QQuickWebEngineView. The BackingStore code path is still supported when the delegated renderer switch is not enabled. To use the new rendering, pass the following switches: --enable-delegated-renderer --enable-threaded-compositing This uses debug, plain color textures until we can fetch tiles and textures from the ResourceProvider across OpenGL context boundaries. Change-Id: I33ea0738dc5a326ef79c1435f75c044c42e8551f Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Add preliminary context menu supportPierre Rossi2013-10-111-0/+17
| | | | | | | | | | | This is essentially the widgets part, with some tricks to get it to honor the widget's context menu policy. It enables c++11 for the widgets library for the convenience of using lambdas, which admitedly we could do without, but seems reasonable considering our timeline and the fact that we build chromium that way. Change-Id: I6a632a78d2aa48fb0dfecfe491e92651d12407db Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Use an enum at creation to initialize the compositing mode.Jocelyn Turcotte2013-09-251-1/+7
| | | | | | | | This value won't change and this will force us to avoid spreading runtime checks. Change-Id: I7928cbe12d75bacddb5ad5c0578ae9a25d7c138e Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Implement window creation through QWebEnginePage::createWindow.Jocelyn Turcotte2013-09-021-6/+31
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Centralize type conversion functions.Jocelyn Turcotte2013-08-201-2/+1
| | | | | | | | | | | | | 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>
* Delay the RWHVDelegate parenting until it's been attached to its RWHV.Jocelyn Turcotte2013-08-121-0/+4
| | | | | | | | 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-121-1/+0
| | | | | | | | | | 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-121-4/+4
| | | | | | | | | 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>
* Don't pass the RWHV to the AdapterClientPierre Rossi2013-08-021-2/+3
| | | | | | | | | | | | | 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>
* Split out the Widgets and QtQuick integrationPierre Rossi2013-07-311-12/+3
| | | | | | | | | | | | | | | 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>
* Get rid of the need to export content::GetContentClient()Andras Becsi2013-07-091-1/+1
| | | | | | | | | | | ContentBrowserClientQt is a singleton which makes it possible to access it from WebContentsViewQt and removes the need for patching chromium. This is similar to how ShellContentBrowserClient is managed in the content shell. Change-Id: I67f35520935388888c7230806ad543a58b3211c3 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
* Fix linking of QtWebEngineProcessAndras Becsi2013-07-041-11/+0
| | | | | | | | | | | | | | Since the global factory function content::CreateWebContentsView is also needed by the web process and we exclude all implementations we have to place the definition of it in the shared static lib. However, to prevent the need for moving platform layer classes back to the shared static lib we have to revert back to use ContentBrowserClient::OverrideCreateWebContentsView in the API layer to create our platform WebContentsViewQt and make the global factory function definition empty. Change-Id: I9d46524b22458b26a043c80df02b4a5fa7d91a55 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Stop using OverrideCreateWebContentsView for creating the contents viewAndras Becsi2013-07-041-1/+8
| | | | | | | | Use the content::CreateWebContentsView factory function to create the contents view since we already have to implement it. Change-Id: Ib60cb29604ac84877e154a47ae27f44672284726 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Implement CreateWebContentsView and exclude web_contents_view_* from build.Zeno Albisser2013-07-021-0/+4
| | | | | Change-Id: I1b5259d7e35631c9cce93b61426846cfb0b92882 Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Implement focus handling functionsAndras Becsi2013-07-021-2/+13
| | | | | | | | | Add setKeyboardFocus and hasKeyboardFocus members to the render widget host view delegates and use them for focus handling. Change-Id: Id117298bccc5fdbbb940869e64d925f3708e808c Reviewed-by: Pierre Rossi <pierre.rossi@gmail.com>
* Implement WebContentsViewQt::GetContainerBoundsAndras Becsi2013-06-271-0/+9
| | | | | | | | This is based on other ports' implementations and seems to be used for sizing / positioning popup menus. Change-Id: I96fa89529157a774571f252d751879b7e61119d0 Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Use WebContentsViewQt::SetPageTitle for title change notificationsAndras Becsi2013-06-251-0/+6
| | | | | | | | | | Using the NotificationObserver mechanism for this purpose seams to be a bit of overkill so remove the inheritance from WebContentsDelegateQt. We can re-add it later if we find useful notifications. Change-Id: I4dff59f66893cd36ed8c0700fa492a3eeb99f87b Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Deduplicate data in private view classesAndras Becsi2013-06-251-0/+62
| | | | | | | | Move common data from WebContentsView private classes to the common base class WebContentsViewQtClient. Change-Id: I77484691a24d14403c8a6e434d6fb33ac557637e Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
* Make use of OverrideCreateWebContentsView.Zeno Albisser2013-05-311-429/+0
|
* make the backingstore use a QPixmap instead of QBackingStoreZeno Albisser2013-05-311-1/+1
|
* Introduce RasterWindowContainer to allow reusing the container with ↵Zeno Albisser2013-05-221-0/+429
different child views. Pass the view to BackingStoreQt::displayBuffer instead of creating it implicitly. Rename RenderWidgetHostView to RenderWidgetHostViewQt and move it into namespace content. Copy in web_contents_view from gtk to allow for modifications outside of the chromium tree. Remove the ViewHostFactory, as it is meant to be used for testing only.