diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-14 20:23:36 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-14 20:23:36 +0000 |
commit | edc286198b90c629bbf6081440512d02aef603d8 (patch) | |
tree | 6a15f556b635515188002bf6296a5334bfb1cf7e /chrome/browser/render_view_host.cc | |
parent | 3d840f473245973dac230a8d998c666e73348b1d (diff) | |
download | chromium_src-edc286198b90c629bbf6081440512d02aef603d8.zip chromium_src-edc286198b90c629bbf6081440512d02aef603d8.tar.gz chromium_src-edc286198b90c629bbf6081440512d02aef603d8.tar.bz2 |
Make the FindInPageController implement its own delegate interface for
RenderViewHost so that we can get rid of the pass-throughs in WebContents.
I removed some redundant checks in WebContents when calling view() for
render_view_host() since that internally checks the null-ness of
render_view_host().
BUG=1323267
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@881 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/render_view_host.cc')
-rw-r--r-- | chrome/browser/render_view_host.cc | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/chrome/browser/render_view_host.cc b/chrome/browser/render_view_host.cc index 00116b4..c37db34 100644 --- a/chrome/browser/render_view_host.cc +++ b/chrome/browser/render_view_host.cc @@ -339,10 +339,6 @@ void RenderViewHost::StopFinding(bool clear_selection) { Send(new ViewMsg_StopFinding(routing_id_, clear_selection)); } -void RenderViewHost::SendFindReplyAck() { - Send(new ViewMsg_FindReplyACK(routing_id_)); -} - void RenderViewHost::AlterTextSize(text_zoom::TextSize size) { Send(new ViewMsg_AlterTextSize(routing_id_, size)); } @@ -936,9 +932,20 @@ void RenderViewHost::OnMsgFindReply(int request_id, const gfx::Rect& selection_rect, int active_match_ordinal, bool final_update) { - delegate_->FindReply(request_id, number_of_matches, - selection_rect, active_match_ordinal, final_update); - SendFindReplyAck(); + RenderViewHostDelegate::FindInPage* delegate = + delegate_->GetFindInPageDelegate(); + if (!delegate) + return; + delegate->FindReply(request_id, number_of_matches, selection_rect, + active_match_ordinal, final_update); + + // Send a notification to the renderer that we are ready to receive more + // results from the scoping effort of the Find operation. The FindInPage + // scoping is asynchronous and periodically sends results back up to the + // browser using IPC. In an effort to not spam the browser we have the + // browser send an ACK for each FindReply message and have the renderer + // queue up the latest status message while waiting for this ACK. + Send(new ViewMsg_FindReplyACK(routing_id_)); } void RenderViewHost::OnMsgUpdateFavIconURL(int32 page_id, |