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

Unified Diff: content/renderer/render_view_impl.h

Issue 10941015: [Android] Upstream the WebView find-in-page API implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fixes. Created 8 years, 3 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
Index: content/renderer/render_view_impl.h
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 637188d974dd420b0a3ccd7198d88b61f2329c6f..3569efc410c31ef515448bc91320268440a164d1 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -1027,6 +1027,12 @@ class RenderViewImpl : public RenderWidget,
void OnStop();
void OnStopFinding(content::StopFindAction action);
CONTENT_EXPORT void OnSwapOut(const ViewMsg_SwapOut_Params& params);
+#if defined(OS_ANDROID)
+ void OnSynchronousFind(int request_id,
+ const string16& search_string,
+ const WebKit::WebFindOptions& options,
+ IPC::Message* reply_msg);
+#endif
void OnThemeChanged();
void OnUndo();
void OnUpdateTargetURLAck();
@@ -1111,6 +1117,11 @@ class RenderViewImpl : public RenderWidget,
// doesn't have a frame at the specified size, the first is returned.
bool DownloadFavicon(int id, const GURL& image_url, int image_size);
+ // Starts a new find-in-page search or looks for the next match.
+ void Find(int request_id,
+ const string16& search_text,
+ const WebKit::WebFindOptions& options);
+
GURL GetAlternateErrorPageURL(const GURL& failed_url,
ErrorPageType error_type);
@@ -1157,9 +1168,20 @@ class RenderViewImpl : public RenderWidget,
// --enable-fixed-layout[=w,h].
void ProcessViewLayoutFlags(const CommandLine& command_line);
+ // Sends a reply to the current find operation handling if it was a
+ // synchronous find request.
+ void SendFindReply(int request_id,
+ int match_count,
+ int ordinal,
+ const WebKit::WebRect& selection_rect,
+ bool final_status_update);
+
// Starts nav_state_sync_timer_ if it isn't already running.
void StartNavStateSyncTimerIfNecessary();
+ // Stops the current find-in-page search.
+ void StopFinding(content::StopFindAction action);
+
// Dispatches the current navigation state to the browser. Called on a
// periodic timer so we don't send too many messages.
void SyncNavigationState();
@@ -1407,6 +1429,14 @@ class RenderViewImpl : public RenderWidget,
typedef std::vector< linked_ptr<content::ContentDetector> >
ContentDetectorList;
ContentDetectorList content_detectors_;
+
+ // Holds the message used to return find results to the browser during
+ // synchronous find-in-page requests. Only non-null during these requests.
+ scoped_ptr<IPC::Message> synchronous_find_reply_message_;
+
+ // The active find-in-page match ordinal during synchronous requests.
+ // Needed to be remembered across WebKit callbacks.
+ int synchronous_find_active_match_ordinal_;
#endif
// Misc ----------------------------------------------------------------------

Powered by Google App Engine
This is Rietveld 408576698