Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5938)

Unified Diff: components/web_view/public/interfaces/frame.mojom

Issue 1371773003: mandoline: Add find in page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase to ToT Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/web_view/frame_tree_delegate.cc ('k') | components/web_view/public/interfaces/web_view.mojom » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/web_view/public/interfaces/frame.mojom
diff --git a/components/web_view/public/interfaces/frame.mojom b/components/web_view/public/interfaces/frame.mojom
index d1a8f807d534260783d2a4a4360947c4c1cd74ef..0ec082b0fb4e0e87aef4241bf90a8dbe5769e7ea 100644
--- a/components/web_view/public/interfaces/frame.mojom
+++ b/components/web_view/public/interfaces/frame.mojom
@@ -110,6 +110,14 @@ interface Frame {
// Dispatches a load event to the parent of the frame.
DispatchLoadEventToParent();
+
+ // Reports the number of matches for a given find. This is an asynchronous
sky 2015/10/05 23:38:27 nit: update grammar 'this is an asynchronous notif
+ // notification can fire multiple times per HighlightFindResults() call.
+ OnFindInFrameCountUpdated(int32 request_id, int32 count,
+ bool final_update);
+
+ // Reports which match is currently highlighted.
+ OnFindInPageSelectionUpdated(int32 request_id, int32 active_match_ordinal);
};
enum ViewConnectType {
@@ -166,4 +174,33 @@ interface FrameClient {
// Called to dispatch a load event of |frame_id| in its parent. This is only
// called on the FrameClient rendering the parent of |frame_id|.
OnDispatchFrameLoadEvent(uint32 frame_id);
+
+ // TODO(erg): Several of these take a WebFindOptions struct; we probably need
+ // to build a Frame version of that struct.
+
+ // Searches for a given string. If a match is found, it will be
+ // selected. Find() will only return true if it found a match, and will return
+ // the result in the future through OnFindInPageSelectionUpdated().
+ //
+ // |request_id| should be a monotonically increasing number which should only
+ // be reused between Find() and the HighlightFindResults() calls that are
+ // searching for the same string. |search_text| may be empty.
+ Find(int32 request_id, string search_text) => (bool found);
sky 2015/10/05 23:38:27 Be aware that there are race conditions with using
+
+ // Stop finding the single find result on the page. If |clear_selection| is
+ // set, it will also clear the selected find text.
+ StopFinding(bool clear_selection);
+
+ // Match every instance of a string in a document asynchronously, highlighting
+ // them and putting a tick mark in the scroll bar. This differs from Find() as
+ // Find() is about finding the one selected instance of the text.
+ // HighlightFindResults() is about highlighting all the instances of the text.
+ //
+ // HighlightFindResults() will asynchronously call
+ // OnFindInFrameCountUpdated() multiple times to report its progress.
+ HighlightFindResults(int32 request_id, string search_test, bool reset);
+
+ // Removes the tick marks and highlighting done by HighlightFindResults() in
+ // this frame.
+ StopHighlightingFindResults();
};
« no previous file with comments | « components/web_view/frame_tree_delegate.cc ('k') | components/web_view/public/interfaces/web_view.mojom » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698