diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2014-05-26 13:58:50 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-28 10:07:32 +0200 |
commit | 3c181552ac5983f93ba0562063897be7772a570b (patch) | |
tree | 39433c520cfa7edb1940743f0ff3dff589714fcd /src/core/web_contents_adapter.cpp | |
parent | 622f613bc4d41f9d3784fc0249e71ce0d3102a97 (diff) |
Fix "findNext" after having navigated to a new page
The findNext flag tells the frame to search starting from the current
selection, but the code assumes that the flag won't be used when there
isn't any find selection (like when the Frame changed).
Make sure that we won't use that flag after we received a load
committed signal.
Change-Id: I10f0f84226232d150f19fd644d7afe78bc425f74
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r-- | src/core/web_contents_adapter.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index ffb31ce8a..8b0aafe21 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -300,7 +300,6 @@ public: scoped_ptr<QtRenderViewObserverHost> renderViewObserverHost; WebContentsAdapterClient *adapterClient; quint64 lastRequestId; - QString lastSearchedString; }; WebContentsAdapterPrivate::WebContentsAdapterPrivate() @@ -650,8 +649,8 @@ quint64 WebContentsAdapter::findText(const QString &subString, bool caseSensitiv blink::WebFindOptions options; options.forward = !findBackward; options.matchCase = caseSensitively; - options.findNext = subString == d->lastSearchedString; - d->lastSearchedString = subString; + options.findNext = subString == d->webContentsDelegate->lastSearchedString(); + d->webContentsDelegate->setLastSearchedString(subString); // Find already allows a request ID as input, but only as an int. // Use the same counter but mod it to MAX_INT, this keeps the same likeliness of request ID clashing. @@ -663,7 +662,7 @@ quint64 WebContentsAdapter::findText(const QString &subString, bool caseSensitiv void WebContentsAdapter::stopFinding() { Q_D(WebContentsAdapter); - d->lastSearchedString = QString(); + d->webContentsDelegate->setLastSearchedString(QString()); d->webContents->GetRenderViewHost()->StopFinding(content::STOP_FIND_ACTION_KEEP_SELECTION); } |