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

Unified Diff: content/common/view_messages.h

Issue 10905058: Upstream the Android port find-in-page feature. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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/common/view_messages.h
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index f0c1bd7a46842fa9c08aa858f32ef90abc20065a..bfd8d4c2b62149f79dac45fbbf9be47f7f088ed9 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -51,6 +51,7 @@
#endif
#if defined(OS_ANDROID)
+#include "ui/gfx/rect_f.h"
#include "webkit/media/android/media_metadata_android.h"
#endif
@@ -786,6 +787,28 @@ IPC_STRUCT_END()
// Messages sent from the browser to the renderer.
+#if defined(OS_ANDROID)
jam 2012/09/04 16:39:09 this isn't the right order to put this message (Vi
Leandro GraciĆ” Gil 2012/09/04 18:25:50 Done.
+// Response to ViewMsg_GetFindMatchRects.
+//
+// |version| will contain the current version number of the renderer's find
+// match list (incremented whenever they change), which should be passed in the
+// next call to ViewMsg_GetFindMatchRects.
+//
+// |rects| will either contain a list of the enclosing rects of all matches
+// found by the most recent Find operation, or will be empty if |version| is not
+// greater than the |current_version| passed to ViewMsg_GetFindMatchRects (hence
+// your locally cached rects should still be valid). The rect coords will be
+// custom normalized fractions of the document size. The rects will be sorted by
+// frame traversal order starting in the main frame, then by dom order.
+//
+// |active_rect| will contain the bounding box of the active find-in-page match
+// marker, in similarly normalized coords (or an empty rect if there isn't one).
+IPC_MESSAGE_ROUTED3(ViewHostMsg_GetFindMatchRects_Reply,
+ int /* version */,
+ std::vector<gfx::RectF> /* rects */,
+ gfx::RectF /* active_rect */)
+#endif
+
// Sent to the RenderView when a new tab is swapped into an existing
// tab and the histories need to be merged. The existing tab has a history of
// |merged_history_length| which precedes the history of the new tab. All
@@ -844,6 +867,28 @@ IPC_SYNC_MESSAGE_CONTROL0_1(ViewHostMsg_GetMonitorColorProfile,
IPC_MESSAGE_CONTROL1(ViewMsg_New,
ViewMsg_New_Params)
+#if defined(OS_ANDROID)
+// Sent when the user clicks on the find result bar to activate a find result.
+// The point (x,y) is in fractions of the content document's width and height.
+IPC_MESSAGE_ROUTED3(ViewMsg_ActivateNearestFindResult,
+ int /* request_id */,
+ float /* x */,
+ float /* y */)
+
+// Sent when the browser wants the bounding boxes of the current find matches.
+//
+// If match rects are already cached on the browser side, |current_version|
+// should be the version number from the ViewHostMsg_GetFindMatchRects_Reply
+// they came in, so the renderer can tell if it needs to send updated rects.
+// Otherwise just pass -1 to always receive the list of rects.
+//
+// There must be an active search string (it is probably most useful to call
+// this immediately after a ViewHostMsg_Find_Reply message arrives with
+// final_update set to true).
+IPC_MESSAGE_ROUTED1(ViewMsg_GetFindMatchRects,
+ int /* current_version */)
+#endif
+
// Reply in response to ViewHostMsg_ShowView or ViewHostMsg_ShowWidget.
// similar to the new command, but used when the renderer created a view
// first, and we need to update it.

Powered by Google App Engine
This is Rietveld 408576698