Handle the ViewHostMsg_FindReply message which is sent by content(renderer) via the TabContentsDelegate.

The other change is to remove an unused Browser member from the ExternalTabContainer class.

BUG=87335
Review URL: http://codereview.chromium.org/7828025

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99275 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 6762a65f..9271d1b 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -301,6 +301,7 @@
                         OnRegisterIntentHandler)
     IPC_MESSAGE_HANDLER(ViewHostMsg_WebIntentDispatch,
                         OnWebIntentDispatch)
+    IPC_MESSAGE_HANDLER(ViewHostMsg_Find_Reply, OnFindReply)
     IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP_EX()
 
@@ -1134,6 +1135,15 @@
                                 data, intent_id);
 }
 
+void TabContents::OnFindReply(int request_id,
+                              int number_of_matches,
+                              const gfx::Rect& selection_rect,
+                              int active_match_ordinal,
+                              bool final_update) {
+  delegate()->FindReply(this, request_id, number_of_matches, selection_rect,
+                        active_match_ordinal, final_update);
+}
+
 // Notifies the RenderWidgetHost instance about the fact that the page is
 // loading, or done loading and calls the base implementation.
 void TabContents::SetIsLoading(bool is_loading,
diff --git a/content/browser/tab_contents/tab_contents.h b/content/browser/tab_contents/tab_contents.h
index 5111387..1e996c0 100644
--- a/content/browser/tab_contents/tab_contents.h
+++ b/content/browser/tab_contents/tab_contents.h
@@ -577,6 +577,9 @@
                            const string16& type,
                            const string16& data,
                            int intent_id);
+  void OnFindReply(int request_id, int number_of_matches,
+                   const gfx::Rect& selection_rect, int active_match_ordinal,
+                   bool final_update);
 
   // Changes the IsLoading state and notifies delegate as needed
   // |details| is used to provide details on the load that just finished
diff --git a/content/browser/tab_contents/tab_contents_delegate.cc b/content/browser/tab_contents/tab_contents_delegate.cc
index 5652481..a6bdb98 100644
--- a/content/browser/tab_contents/tab_contents_delegate.cc
+++ b/content/browser/tab_contents/tab_contents_delegate.cc
@@ -316,6 +316,14 @@
                                             int intent_id) {
 }
 
+void TabContentsDelegate::FindReply(TabContents* tab,
+                                    int request_id,
+                                    int number_of_matches,
+                                    const gfx::Rect& selection_rect,
+                                    int active_match_ordinal,
+                                    bool final_update) {
+}
+
 TabContentsDelegate::~TabContentsDelegate() {
   while (!attached_contents_.empty()) {
     TabContents* tab_contents = *attached_contents_.begin();
diff --git a/content/browser/tab_contents/tab_contents_delegate.h b/content/browser/tab_contents/tab_contents_delegate.h
index 5894faf..9638775 100644
--- a/content/browser/tab_contents/tab_contents_delegate.h
+++ b/content/browser/tab_contents/tab_contents_delegate.h
@@ -338,6 +338,16 @@
                                  const string16& data,
                                  int intent_id);
 
+  // Result of string search in the page. This includes the number of matches
+  // found and the selection rect (in screen coordinates) for the string found.
+  // If |final_update| is false, it indicates that more results follow.
+  virtual void FindReply(TabContents* tab,
+                         int request_id,
+                         int number_of_matches,
+                         const gfx::Rect& selection_rect,
+                         int active_match_ordinal,
+                         bool final_update);
+
  protected:
   virtual ~TabContentsDelegate();