Skip to content

Commit 1d88a66

Browse files
committed
IBrowserHost.Find remove identifier param
Resolves #4013
1 parent 9d251a3 commit 1d88a66

File tree

6 files changed

+10
-16
lines changed

6 files changed

+10
-16
lines changed

CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,11 @@ void CefBrowserHostWrapper::RunFileDialog(CefFileDialogMode mode, String^ title,
315315
new CefRunFileDialogCallbackAdapter(callback));
316316
}
317317

318-
void CefBrowserHostWrapper::Find(int identifier, String^ searchText, bool forward, bool matchCase, bool findNext)
318+
void CefBrowserHostWrapper::Find(String^ searchText, bool forward, bool matchCase, bool findNext)
319319
{
320320
ThrowIfDisposed();
321321

322-
_browserHost->Find(identifier, StringUtils::ToNative(searchText), forward, matchCase, findNext);
322+
_browserHost->Find(StringUtils::ToNative(searchText), forward, matchCase, findNext);
323323
}
324324

325325
void CefBrowserHostWrapper::StopFinding(bool clearSelection)

CefSharp.Core.Runtime/Internals/CefBrowserHostWrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ namespace CefSharp
8888

8989
virtual void RunFileDialog(CefFileDialogMode mode, String^ title, String^ defaultFilePath, IList<String^>^ acceptFilters, int selectedAcceptFilter, IRunFileDialogCallback^ callback);
9090

91-
virtual void Find(int identifier, String^ searchText, bool forward, bool matchCase, bool findNext);
91+
virtual void Find(String^ searchText, bool forward, bool matchCase, bool findNext);
9292
virtual void StopFinding(bool clearSelection);
9393

9494
virtual void SetFocus(bool focus);

CefSharp.WinForms.Example/BrowserTabUserControl.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ private void Find(bool next)
525525
{
526526
if (!string.IsNullOrEmpty(findTextBox.Text))
527527
{
528-
Browser.Find(0, findTextBox.Text, next, false, false);
528+
Browser.Find(findTextBox.Text, next, false, false);
529529
}
530530
}
531531

CefSharp.Wpf/Handler/ContextMenuHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ protected virtual void ExecuteCommand(IBrowser browser, ContextMenuExecuteModel
265265
}
266266
case CefMenuCommand.Find:
267267
{
268-
browser.GetHost().Find(0, model.SelectionText, true, false, false);
268+
browser.GetHost().Find(model.SelectionText, true, false, false);
269269
break;
270270
}
271271

CefSharp/IBrowserHost.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,16 +189,12 @@ public interface IBrowserHost : IDisposable
189189
/// <summary>
190190
/// Search for <paramref name="searchText"/>.
191191
/// </summary>
192-
/// <param name="identifier">must be a unique ID and these IDs
193-
/// must strictly increase so that newer requests always have greater IDs than
194-
/// older requests. If identifier is zero or less than the previous ID value
195-
/// then it will be automatically assigned a new valid ID. </param>
196192
/// <param name="searchText">text to search for</param>
197193
/// <param name="forward">indicates whether to search forward or backward within the page</param>
198194
/// <param name="matchCase">indicates whether the search should be case-sensitive</param>
199195
/// <param name="findNext">indicates whether this is the first request or a follow-up</param>
200196
/// <remarks>The <see cref="IFindHandler"/> instance, if any, will be called to report find results.</remarks>
201-
void Find(int identifier, string searchText, bool forward, bool matchCase, bool findNext);
197+
void Find(string searchText, bool forward, bool matchCase, bool findNext);
202198

203199
/// <summary>
204200
/// Returns the extension hosted in this browser or null if no extension is hosted. See <see cref="IRequestContext.LoadExtension"/> for details.

CefSharp/WebBrowserExtensions.cs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -957,34 +957,32 @@ public static void SetZoomLevel(this IChromiumWebBrowserBase browser, double zoo
957957
/// Search for text within the current page.
958958
/// </summary>
959959
/// <param name="cefBrowser">The ChromiumWebBrowser instance this method extends.</param>
960-
/// <param name="identifier">Can be used in can conjunction with searchText to have multiple searches running simultaneously.</param>
961960
/// <param name="searchText">search text.</param>
962961
/// <param name="forward">indicates whether to search forward or backward within the page.</param>
963962
/// <param name="matchCase">indicates whether the search should be case-sensitive.</param>
964963
/// <param name="findNext">indicates whether this is the first request or a follow-up.</param>
965-
public static void Find(this IBrowser cefBrowser, int identifier, string searchText, bool forward, bool matchCase, bool findNext)
964+
public static void Find(this IBrowser cefBrowser, string searchText, bool forward, bool matchCase, bool findNext)
966965
{
967966
var host = cefBrowser.GetHost();
968967
ThrowExceptionIfBrowserHostNull(host);
969968

970-
host.Find(identifier, searchText, forward, matchCase, findNext);
969+
host.Find(searchText, forward, matchCase, findNext);
971970
}
972971

973972
/// <summary>
974973
/// Search for text within the current page.
975974
/// </summary>
976975
/// <param name="browser">The ChromiumWebBrowser instance this method extends.</param>
977-
/// <param name="identifier">Can be used in can conjunction with searchText to have multiple searches running simultaneously.</param>
978976
/// <param name="searchText">search text.</param>
979977
/// <param name="forward">indicates whether to search forward or backward within the page.</param>
980978
/// <param name="matchCase">indicates whether the search should be case-sensitive.</param>
981979
/// <param name="findNext">indicates whether this is the first request or a follow-up.</param>
982-
public static void Find(this IChromiumWebBrowserBase browser, int identifier, string searchText, bool forward, bool matchCase, bool findNext)
980+
public static void Find(this IChromiumWebBrowserBase browser, string searchText, bool forward, bool matchCase, bool findNext)
983981
{
984982
var cefBrowser = browser.BrowserCore;
985983
cefBrowser.ThrowExceptionIfBrowserNull();
986984

987-
cefBrowser.Find(identifier, searchText, forward, matchCase, findNext);
985+
cefBrowser.Find(searchText, forward, matchCase, findNext);
988986
}
989987

990988
/// <summary>

0 commit comments

Comments
 (0)