Upstream the Android port find-in-page feature.

This patch provides the find-in-page Chromium code for the Android port.
Further code implementing the feature for Android WebView will be added later in a different patch.

Unlike the previous approach (CL 10699024) this patch uses the FindTabHelper class as Desktop Chrome does, introducing its new required APIs there. It also introduces FindMatchRects in a way symmetrical to the current Find/FindReply implementation in order to simplify any possible future adoption of this API by other platforms.


BUG=136762

Review URL: https://chromiumcodereview.appspot.com/10905058

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154893 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index a14bf00..2aa80c7 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -677,6 +677,10 @@
     IPC_MESSAGE_HANDLER(ViewHostMsg_RegisterProtocolHandler,
                         OnRegisterProtocolHandler)
     IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply)
+#if defined(OS_ANDROID)
+    IPC_MESSAGE_HANDLER(ViewHostMsg_FindMatchRects_Reply,
+                        OnFindMatchRectsReply)
+#endif
     IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin)
     IPC_MESSAGE_HANDLER(ViewHostMsg_AppCacheAccessed, OnAppCacheAccessed)
     IPC_MESSAGE_HANDLER(ViewHostMsg_OpenColorChooser, OnOpenColorChooser)
@@ -2200,6 +2204,16 @@
   }
 }
 
+#if defined(OS_ANDROID)
+void WebContentsImpl::OnFindMatchRectsReply(
+    int version,
+    const std::vector<gfx::RectF>& rects,
+    const gfx::RectF& active_rect) {
+  if (delegate_)
+    delegate_->FindMatchRectsReply(this, version, rects, active_rect);
+}
+#endif
+
 void WebContentsImpl::OnCrashedPlugin(const FilePath& plugin_path) {
   FOR_EACH_OBSERVER(WebContentsObserver, observers_,
                     PluginCrashed(plugin_path));