From 1fcd7970e07a0ecab206224824d1c71488fc19e9 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Wed, 15 Jan 2014 19:10:22 +0100 Subject: Implement QWebEnginePage::toHtml and toPlainText 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 --- src/core/qt_render_view_observer_host.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/core/qt_render_view_observer_host.cpp') diff --git a/src/core/qt_render_view_observer_host.cpp b/src/core/qt_render_view_observer_host.cpp index fec2c4b0c..4b3cc0189 100644 --- a/src/core/qt_render_view_observer_host.cpp +++ b/src/core/qt_render_view_observer_host.cpp @@ -51,10 +51,24 @@ QtRenderViewObserverHost::QtRenderViewObserverHost(content::WebContents *webCont { } +void QtRenderViewObserverHost::fetchDocumentMarkup(quint64 requestId) +{ + Send(new QtRenderViewObserver_FetchDocumentMarkup(routing_id(), requestId)); +} + +void QtRenderViewObserverHost::fetchDocumentInnerText(quint64 requestId) +{ + Send(new QtRenderViewObserver_FetchDocumentInnerText(routing_id(), requestId)); +} + bool QtRenderViewObserverHost::OnMessageReceived(const IPC::Message& message) { bool handled = true; IPC_BEGIN_MESSAGE_MAP(QtRenderViewObserverHost, message) + IPC_MESSAGE_HANDLER(QtRenderViewObserverHost_DidFetchDocumentMarkup, + onDidFetchDocumentMarkup) + IPC_MESSAGE_HANDLER(QtRenderViewObserverHost_DidFetchDocumentInnerText, + onDidFetchDocumentInnerText) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; -- cgit v1.2.3