diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-01-15 19:06:17 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-22 08:45:14 +0100 |
commit | 3fcd31f5bd86cb568b1ca4f4f5c7c12c6675dceb (patch) | |
tree | 174654f0843830a86f80c3a379442708003e4f7e /src/core/web_contents_adapter.cpp | |
parent | 6d760436bc0d7081d5bdb50e4141171b6ba940ee (diff) |
Add a stub message system to communicate with the blink WebView
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>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 56b56ce33..bd3be1744 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -43,6 +43,7 @@ #include "browser_context_qt.h" #include "content_browser_client_qt.h" #include "javascript_dialog_manager_qt.h" +#include "qt_render_view_observer_host.h" #include "type_conversion.h" #include "web_contents_adapter_client.h" #include "web_contents_delegate_qt.h" @@ -167,6 +168,7 @@ public: scoped_refptr<WebEngineContext> engineContext; scoped_ptr<content::WebContents> webContents; scoped_ptr<WebContentsDelegateQt> webContentsDelegate; + scoped_ptr<QtRenderViewObserverHost> renderViewObserverHost; WebContentsAdapterClient *adapterClient; quint64 lastRequestId; }; @@ -211,8 +213,9 @@ void WebContentsAdapter::initialize(WebContentsAdapterClient *adapterClient) rendererPrefs->caret_blink_interval = 0.5 * static_cast<double>(qtCursorFlashTime) / 1000; d->webContents->GetRenderViewHost()->SyncRendererPrefs(); - // Create and attach a WebContentsDelegateQt to the WebContents. + // Create and attach observers to the WebContents. d->webContentsDelegate.reset(new WebContentsDelegateQt(d->webContents.get(), adapterClient)); + d->renderViewObserverHost.reset(new QtRenderViewObserverHost(d->webContents.get(), adapterClient)); // Let the WebContent's view know about the WebContentsAdapterClient. WebContentsViewQt* contentsView = static_cast<WebContentsViewQt*>(d->webContents->GetView()); |