summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host
diff options
context:
space:
mode:
authorestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-11 18:19:00 +0000
committerestade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-11 18:19:00 +0000
commit5bc8fe91607f20f2d43dc461ca188dd07b55d435 (patch)
treeca6551f9d816757942485ee7d3542c5aeb4d2fed /chrome/browser/renderer_host
parent3148c0ae4462e01f4b830b8d2150dcd7fee2cb3b (diff)
downloadchromium_src-5bc8fe91607f20f2d43dc461ca188dd07b55d435.zip
chromium_src-5bc8fe91607f20f2d43dc461ca188dd07b55d435.tar.gz
chromium_src-5bc8fe91607f20f2d43dc461ca188dd07b55d435.tar.bz2
Allow users to close the find session and activate the current link via ctrl-enter.
this only hooks up ctrl-enter on gtk for now, but adding it on windows/mac should be trivial webkit side, which needs to land first, is here: https://bugs.webkit.org/show_bug.cgi?id=35407 This also enables the FindInPageControllerTest tests on linux/gtk. BUG=29500 TEST=FindInPageControllerTest.ActivateLinkNavigatesPage Review URL: http://codereview.chromium.org/660137 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41291 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc20
-rw-r--r--chrome/browser/renderer_host/render_view_host.h6
2 files changed, 21 insertions, 5 deletions
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index 59ba321..da86877 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -391,8 +391,24 @@ void RenderViewHost::StartFinding(int request_id,
// The result of the search is sent as a notification message by the renderer.
}
-void RenderViewHost::StopFinding(bool clear_selection) {
- Send(new ViewMsg_StopFinding(routing_id(), clear_selection));
+void RenderViewHost::StopFinding(
+ FindBarController::SelectionAction 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();
+ }
+ Send(new ViewMsg_StopFinding(routing_id(), params));
}
void RenderViewHost::Zoom(PageZoom::Function function) {
diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h
index e860dc2..4059bec 100644
--- a/chrome/browser/renderer_host/render_view_host.h
+++ b/chrome/browser/renderer_host/render_view_host.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/scoped_ptr.h"
+#include "chrome/browser/find_bar_controller.h"
#include "chrome/browser/renderer_host/render_widget_host.h"
#include "chrome/common/content_settings_types.h"
#include "chrome/common/page_zoom.h"
@@ -204,9 +205,8 @@ class RenderViewHost : public RenderWidgetHost {
bool match_case,
bool find_next);
- // Cancel a pending find operation. If |clear_selection| is true, it will also
- // clear the selection on the focused frame.
- void StopFinding(bool clear_selection);
+ // Cancel a pending find operation.
+ void StopFinding(FindBarController::SelectionAction selection_action);
// Change the zoom level of a page.
void Zoom(PageZoom::Function function);