summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2016-11-24 15:02:34 +0100
committerPeter Varga <pvarga@inf.u-szeged.hu>2016-11-25 13:10:44 +0000
commit9894a46ced4e760a90b8e0508ca1452f5d2fd7ef (patch)
treeca983d2d0b3d2153b31bdda591893b6f2bf99700 /src/core/web_contents_delegate_qt.cpp
parent5bd02ef363a7fcfdb0c34dcd75938c54163bf10f (diff)
Rework and fix loadVisuallyCommitted signal
- Remove RenderViewObserverHostQt_DidFirstVisuallyNonEmptyLayout message and use WebContentsObserver::DidFirstVisuallyNonEmptyPaint instead. - The order of the DidFirstVisuallyNonEmptyPaint and OnSwapCompositorFrame events is not guaranteed. Check for both events to do not miss to send any loadVisuallyCommitted signal. Change-Id: Ic733b3e9a6fae64b1d827e8e07514f180273cf8c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r--src/core/web_contents_delegate_qt.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 0f7808e51..87badc189 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -51,6 +51,7 @@
#include "file_picker_controller.h"
#include "media_capture_devices_dispatcher.h"
#include "network_delegate_qt.h"
+#include "render_widget_host_view_qt.h"
#include "type_conversion.h"
#include "web_contents_adapter_client.h"
#include "web_contents_adapter_p.h"
@@ -387,6 +388,21 @@ void WebContentsDelegateQt::WasShown()
web_cache::WebCacheManager::GetInstance()->ObserveActivity(web_contents()->GetRenderProcessHost()->GetID());
}
+void WebContentsDelegateQt::DidFirstVisuallyNonEmptyPaint()
+{
+ RenderWidgetHostViewQt *rwhv = static_cast<RenderWidgetHostViewQt*>(web_contents()->GetRenderWidgetHostView());
+ if (!rwhv)
+ return;
+
+ RenderWidgetHostViewQt::LoadVisuallyCommittedState loadVisuallyCommittedState = rwhv->getLoadVisuallyCommittedState();
+ if (loadVisuallyCommittedState == RenderWidgetHostViewQt::NotCommitted) {
+ rwhv->setLoadVisuallyCommittedState(RenderWidgetHostViewQt::DidFirstVisuallyNonEmptyPaint);
+ } else if (loadVisuallyCommittedState == RenderWidgetHostViewQt::DidFirstCompositorFrameSwap) {
+ m_viewClient->loadVisuallyCommitted();
+ rwhv->setLoadVisuallyCommittedState(RenderWidgetHostViewQt::NotCommitted);
+ }
+}
+
void WebContentsDelegateQt::RequestToLockMouse(content::WebContents *web_contents, bool user_gesture, bool last_unlocked_by_target)
{
Q_UNUSED(user_gesture);