diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 22:21:26 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-19 22:21:26 +0000 |
commit | 216813957f67962e1c50fcbbad0d3e8fcd17760e (patch) | |
tree | 273740c80787aa384f3271aae447b8b2a135e65f /chrome/browser/ui/find_bar | |
parent | 061c8a500fdcd398614a369093d1f80d7ac8190d (diff) | |
download | chromium_src-216813957f67962e1c50fcbbad0d3e8fcd17760e.zip chromium_src-216813957f67962e1c50fcbbad0d3e8fcd17760e.tar.gz chromium_src-216813957f67962e1c50fcbbad0d3e8fcd17760e.tar.bz2 |
Remove functions in RenderViewHost and RenderWidgetHost that just send an IPC message and are called by one or two places. Have the callers send the message instead. Also remove functions which dispatch an IPC only to call TabContents. Dispatch in TabContents instead.
Review URL: http://codereview.chromium.org/7037041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85990 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/ui/find_bar')
-rw-r--r-- | chrome/browser/ui/find_bar/find_tab_helper.cc | 35 |
1 files changed, 29 insertions, 6 deletions
diff --git a/chrome/browser/ui/find_bar/find_tab_helper.cc b/chrome/browser/ui/find_bar/find_tab_helper.cc index a44a11a..9b66bd9 100644 --- a/chrome/browser/ui/find_bar/find_tab_helper.cc +++ b/chrome/browser/ui/find_bar/find_tab_helper.cc @@ -12,6 +12,9 @@ #include "content/browser/tab_contents/tab_contents.h" #include "content/common/notification_service.h" #include "content/common/view_messages.h" +#include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h" + +using WebKit::WebFindOptions; // static int FindTabHelper::find_request_id_counter_ = -1; @@ -71,11 +74,14 @@ void FindTabHelper::StartFinding(string16 search_string, // Keep track of what the last search was across the tabs. FindBarState* find_bar_state = tab_contents()->profile()->GetFindBarState(); find_bar_state->set_last_prepopulate_text(find_text_); - tab_contents()->render_view_host()->StartFinding(current_find_request_id_, - find_text_, - forward_direction, - case_sensitive, - find_next); + + WebFindOptions options; + options.forward = forward_direction; + options.matchCase = case_sensitive; + options.findNext = find_next; + tab_contents()->render_view_host()->Send(new ViewMsg_Find( + tab_contents()->render_view_host()->routing_id(), + current_find_request_id_, find_text_, options)); } void FindTabHelper::StopFinding( @@ -93,7 +99,24 @@ void FindTabHelper::StopFinding( find_text_.clear(); find_op_aborted_ = true; last_search_result_ = FindNotificationDetails(); - tab_contents()->render_view_host()->StopFinding(selection_action); + + ViewMsg_StopFinding_Params params; + switch (selection_action) { + case FindBarController::kClearSelection: + params.action = ViewMsg_StopFinding_Params::kClearSelection; + break; + case FindBarController::kKeepSelection: + params.action = ViewMsg_StopFinding_Params::kKeepSelection; + break; + case FindBarController::kActivateSelection: + params.action = ViewMsg_StopFinding_Params::kActivateSelection; + break; + default: + NOTREACHED(); + params.action = ViewMsg_StopFinding_Params::kKeepSelection; + } + tab_contents()->render_view_host()->Send(new ViewMsg_StopFinding( + tab_contents()->render_view_host()->routing_id(), params)); } bool FindTabHelper::OnMessageReceived(const IPC::Message& message) { |