diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2019-07-11 13:15:39 +0200 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2019-08-22 13:00:16 +0200 |
commit | 55a4c28542c6dc9e4a4edc0aab7043feef2ab0d2 (patch) | |
tree | 551751f87ed36388ebd545edd5f31a48859a2719 /src/core/web_contents_delegate_qt.h | |
parent | f0c471d9e2f3e9808cbf8c57bee533e8254ad1c5 (diff) |
Refactor findText handling
Move most of the findText logic to the QtWebEngineCore::FindTextHelper
class. This change also separates findText callbacks in the new class
for getting rid of the request ID conversion and make it easier to
remove them in Qt6.
Task-number: QTBUG-50420
Change-Id: I348cedd0f90a49f9b360165c46319aeed2c236c0
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Diffstat (limited to 'src/core/web_contents_delegate_qt.h')
-rw-r--r-- | src/core/web_contents_delegate_qt.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h index 00b715c30..f1d5ed76c 100644 --- a/src/core/web_contents_delegate_qt.h +++ b/src/core/web_contents_delegate_qt.h @@ -50,6 +50,7 @@ #include "color_chooser_controller.h" #include "favicon_manager.h" +#include "find_text_helper.h" #include "javascript_dialog_manager_qt.h" #include <QtCore/qvector.h> @@ -112,10 +113,6 @@ class WebContentsDelegateQt : public content::WebContentsDelegate public: WebContentsDelegateQt(content::WebContents*, WebContentsAdapterClient *adapterClient); ~WebContentsDelegateQt(); - QString lastSearchedString() const { return m_lastSearchedString; } - void setLastSearchedString(const QString &s) { m_lastSearchedString = s; } - int lastReceivedFindReply() const { return m_lastReceivedFindReply; } - void setLastReceivedFindReply(int id) { m_lastReceivedFindReply = id; } QUrl url() const { return m_url; } QString title() const { return m_title; } @@ -178,6 +175,7 @@ public: void requestUserNotificationPermission(const QUrl &requestingOrigin); void launchExternalURL(const QUrl &url, ui::PageTransition page_transition, bool is_main_frame, bool has_user_gesture); FaviconManager *faviconManager(); + FindTextHelper *findTextHelper(); void setSavePageInfo(const SavePageInfo &spi) { m_savePageInfo = spi; } const SavePageInfo &savePageInfo() { return m_savePageInfo; } @@ -213,10 +211,9 @@ private: int &streamCount(blink::MediaStreamType type); WebContentsAdapterClient *m_viewClient; - QString m_lastSearchedString; - int m_lastReceivedFindReply; QVector<int64_t> m_loadingErrorFrameList; QScopedPointer<FaviconManager> m_faviconManager; + QScopedPointer<FindTextHelper> m_findTextHelper; SavePageInfo m_savePageInfo; QSharedPointer<FilePickerController> m_filePickerController; QUrl m_initialTargetUrl; |