Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Unified Diff: chrome/renderer/render_view.cc

Issue 660137: Allow users to close the find session and activate the current link via ctrl-... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/render_view.h ('k') | chrome/test/data/find_in_page/link.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 41087)
+++ chrome/renderer/render_view.cc (working copy)
@@ -146,6 +146,7 @@
using WebKit::WebData;
using WebKit::WebDataSource;
using WebKit::WebDevToolsAgent;
+using WebKit::WebDocument;
using WebKit::WebDragData;
using WebKit::WebDragOperation;
using WebKit::WebDragOperationsMask;
@@ -980,11 +981,13 @@
devtools_client_.reset(new DevToolsClient(this));
}
-void RenderView::OnStopFinding(bool clear_selection) {
+void RenderView::OnStopFinding(const ViewMsg_StopFinding_Params& params) {
WebView* view = webview();
if (!view)
return;
+ bool clear_selection =
+ params.action == ViewMsg_StopFinding_Params::kClearSelection;
if (clear_selection)
view->focusedFrame()->executeCommand(WebString::fromUTF8("Unselect"));
@@ -993,6 +996,18 @@
frame->stopFinding(clear_selection);
frame = frame->traverseNext(false);
}
+
+ if (params.action == ViewMsg_StopFinding_Params::kActivateSelection) {
+ WebFrame* focused_frame = view->focusedFrame();
+ if (focused_frame) {
+ WebDocument doc = focused_frame->document();
+ if (!doc.isNull()) {
+ WebNode node = doc.focusedNode();
+ if (!node.isNull())
+ node.simulateClick();
+ }
+ }
+ }
}
void RenderView::OnFindReplyAck() {
« no previous file with comments | « chrome/renderer/render_view.h ('k') | chrome/test/data/find_in_page/link.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698