summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
diff options
context:
space:
mode:
authorKari Oikarinen <kari.oikarinen@qt.io>2019-09-04 12:12:51 +0300
committerKari Oikarinen <kari.oikarinen@qt.io>2019-09-04 12:12:51 +0300
commitff1272de6bb44dda30b90c62806d037ca4ef8b77 (patch)
tree8b278bdb97f667ce54e3b36b71e4b6b8c7f49df3 /src/core/web_contents_delegate_qt.cpp
parent48c85451adf1d530bccf9bfb542abb3211f0bf36 (diff)
parenta6abc01319798e2175914323273e91927516eba0 (diff)
Merge dev into 5.14 (delayed final downmerge)
This replicates the effects of the fast-forward merge that should have been pushed on 2019-08-27 as the final down-merge from dev to 5.14. Task-number: QTBUG-78019 Change-Id: I89e81a2d285e57eaf29e8cfef4abaf458b352c3b
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r--src/core/web_contents_delegate_qt.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index f18617f8e..9855e3859 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -102,8 +102,8 @@ static WebContentsAdapterClient::JavaScriptConsoleMessageLevel mapToJavascriptCo
WebContentsDelegateQt::WebContentsDelegateQt(content::WebContents *webContents, WebContentsAdapterClient *adapterClient)
: m_viewClient(adapterClient)
- , m_lastReceivedFindReply(0)
, m_faviconManager(new FaviconManager(webContents, adapterClient))
+ , m_findTextHelper(new FindTextHelper(webContents, adapterClient))
, m_lastLoadProgress(-1)
, m_loadingState(determineLoadingState(webContents))
, m_didStartLoadingSeen(m_loadingState == LoadingState::Loading)
@@ -350,9 +350,7 @@ void WebContentsDelegateQt::EmitLoadFinished(bool success, const QUrl &url, bool
void WebContentsDelegateQt::EmitLoadCommitted()
{
- // Make sure that we don't set the findNext WebFindOptions on a new frame.
- m_lastSearchedString = QString();
-
+ m_findTextHelper->handleLoadCommitted();
m_viewClient->loadCommitted();
m_viewClient->updateNavigationActions();
}
@@ -577,13 +575,7 @@ bool WebContentsDelegateQt::DidAddMessageToConsole(content::WebContents *source,
void WebContentsDelegateQt::FindReply(content::WebContents *source, int request_id, int number_of_matches, const gfx::Rect& selection_rect, int active_match_ordinal, bool final_update)
{
- Q_UNUSED(source)
- Q_UNUSED(selection_rect)
- Q_UNUSED(active_match_ordinal)
- if (final_update && request_id > m_lastReceivedFindReply) {
- m_lastReceivedFindReply = request_id;
- m_viewClient->didFindText(request_id, number_of_matches);
- }
+ m_findTextHelper->handleFindReply(source, request_id, number_of_matches, selection_rect, active_match_ordinal, final_update);
}
void WebContentsDelegateQt::RequestMediaAccessPermission(content::WebContents *web_contents, const content::MediaStreamRequest &request, content::MediaResponseCallback callback)
@@ -623,13 +615,7 @@ void WebContentsDelegateQt::DidFirstVisuallyNonEmptyPaint()
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);
- }
+ rwhv->OnDidFirstVisuallyNonEmptyPaint();
}
void WebContentsDelegateQt::ActivateContents(content::WebContents* contents)
@@ -798,6 +784,11 @@ FaviconManager *WebContentsDelegateQt::faviconManager()
return m_faviconManager.data();
}
+FindTextHelper *WebContentsDelegateQt::findTextHelper()
+{
+ return m_findTextHelper.data();
+}
+
WebEngineSettings *WebContentsDelegateQt::webEngineSettings() const {
return m_viewClient->webEngineSettings();
}