From 3fcd31f5bd86cb568b1ca4f4f5c7c12c6675dceb Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Wed, 15 Jan 2014 19:06:17 +0100 Subject: 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 --- src/core/web_contents_adapter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/core/web_contents_adapter.cpp') 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 engineContext; scoped_ptr webContents; scoped_ptr webContentsDelegate; + scoped_ptr renderViewObserverHost; WebContentsAdapterClient *adapterClient; quint64 lastRequestId; }; @@ -211,8 +213,9 @@ void WebContentsAdapter::initialize(WebContentsAdapterClient *adapterClient) rendererPrefs->caret_blink_interval = 0.5 * static_cast(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(d->webContents->GetView()); -- cgit v1.2.3