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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/renderer/render_view.h" 5 #include "chrome/renderer/render_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 using WebKit::WebAccessibilityObject; 139 using WebKit::WebAccessibilityObject;
140 using WebKit::WebColor; 140 using WebKit::WebColor;
141 using WebKit::WebColorName; 141 using WebKit::WebColorName;
142 using WebKit::WebConsoleMessage; 142 using WebKit::WebConsoleMessage;
143 using WebKit::WebContextMenuData; 143 using WebKit::WebContextMenuData;
144 using WebKit::WebCookieJar; 144 using WebKit::WebCookieJar;
145 using WebKit::WebCString; 145 using WebKit::WebCString;
146 using WebKit::WebData; 146 using WebKit::WebData;
147 using WebKit::WebDataSource; 147 using WebKit::WebDataSource;
148 using WebKit::WebDevToolsAgent; 148 using WebKit::WebDevToolsAgent;
149 using WebKit::WebDocument;
149 using WebKit::WebDragData; 150 using WebKit::WebDragData;
150 using WebKit::WebDragOperation; 151 using WebKit::WebDragOperation;
151 using WebKit::WebDragOperationsMask; 152 using WebKit::WebDragOperationsMask;
152 using WebKit::WebEditingAction; 153 using WebKit::WebEditingAction;
153 using WebKit::WebFindOptions; 154 using WebKit::WebFindOptions;
154 using WebKit::WebFormElement; 155 using WebKit::WebFormElement;
155 using WebKit::WebFrame; 156 using WebKit::WebFrame;
156 using WebKit::WebHistoryItem; 157 using WebKit::WebHistoryItem;
157 using WebKit::WebInputElement; 158 using WebKit::WebInputElement;
158 using WebKit::WebMediaPlayer; 159 using WebKit::WebMediaPlayer;
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after
973 974
974 webview()->focusedFrame()->executeCommand( 975 webview()->focusedFrame()->executeCommand(
975 WebString::fromUTF8(name), WebString::fromUTF8(value)); 976 WebString::fromUTF8(name), WebString::fromUTF8(value));
976 } 977 }
977 978
978 void RenderView::OnSetupDevToolsClient() { 979 void RenderView::OnSetupDevToolsClient() {
979 DCHECK(!devtools_client_.get()); 980 DCHECK(!devtools_client_.get());
980 devtools_client_.reset(new DevToolsClient(this)); 981 devtools_client_.reset(new DevToolsClient(this));
981 } 982 }
982 983
983 void RenderView::OnStopFinding(bool clear_selection) { 984 void RenderView::OnStopFinding(const ViewMsg_StopFinding_Params& params) {
984 WebView* view = webview(); 985 WebView* view = webview();
985 if (!view) 986 if (!view)
986 return; 987 return;
987 988
989 bool clear_selection =
990 params.action == ViewMsg_StopFinding_Params::kClearSelection;
988 if (clear_selection) 991 if (clear_selection)
989 view->focusedFrame()->executeCommand(WebString::fromUTF8("Unselect")); 992 view->focusedFrame()->executeCommand(WebString::fromUTF8("Unselect"));
990 993
991 WebFrame* frame = view->mainFrame(); 994 WebFrame* frame = view->mainFrame();
992 while (frame) { 995 while (frame) {
993 frame->stopFinding(clear_selection); 996 frame->stopFinding(clear_selection);
994 frame = frame->traverseNext(false); 997 frame = frame->traverseNext(false);
995 } 998 }
999
1000 if (params.action == ViewMsg_StopFinding_Params::kActivateSelection) {
1001 WebFrame* focused_frame = view->focusedFrame();
1002 if (focused_frame) {
1003 WebDocument doc = focused_frame->document();
1004 if (!doc.isNull()) {
1005 WebNode node = doc.focusedNode();
1006 if (!node.isNull())
1007 node.simulateClick();
1008 }
1009 }
1010 }
996 } 1011 }
997 1012
998 void RenderView::OnFindReplyAck() { 1013 void RenderView::OnFindReplyAck() {
999 // Check if there is any queued up request waiting to be sent. 1014 // Check if there is any queued up request waiting to be sent.
1000 if (queued_find_reply_message_.get()) { 1015 if (queued_find_reply_message_.get()) {
1001 // Send the search result over to the browser process. 1016 // Send the search result over to the browser process.
1002 Send(queued_find_reply_message_.get()); 1017 Send(queued_find_reply_message_.get());
1003 queued_find_reply_message_.release(); 1018 queued_find_reply_message_.release();
1004 } 1019 }
1005 } 1020 }
(...skipping 3626 matching lines...) Expand 10 before | Expand all | Expand 10 after
4632 void RenderView::GPUPluginBuffersSwapped(gfx::PluginWindowHandle window) { 4647 void RenderView::GPUPluginBuffersSwapped(gfx::PluginWindowHandle window) {
4633 Send(new ViewHostMsg_GPUPluginBuffersSwapped(routing_id(), window)); 4648 Send(new ViewHostMsg_GPUPluginBuffersSwapped(routing_id(), window));
4634 } 4649 }
4635 #endif 4650 #endif
4636 4651
4637 WebKit::WebGeolocationServiceInterface* RenderView::getGeolocationService() { 4652 WebKit::WebGeolocationServiceInterface* RenderView::getGeolocationService() {
4638 if (!geolocation_dispatcher_.get()) 4653 if (!geolocation_dispatcher_.get())
4639 geolocation_dispatcher_.reset(new GeolocationDispatcher(this)); 4654 geolocation_dispatcher_.reset(new GeolocationDispatcher(this));
4640 return geolocation_dispatcher_.get(); 4655 return geolocation_dispatcher_.get();
4641 } 4656 }
OLDNEW
« 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