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

Side by Side Diff: webkit/glue/webview_impl.cc

Issue 62129: Find should allow keyboard scrolling while Find bar has focus (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 8 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 | « webkit/glue/webview_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2007 Google Inc. All Rights Reserved. 2 * Copyright 2007 Google Inc. All Rights Reserved.
3 * 3 *
4 * Portions Copyright (C) 2006 Apple Computer, Inc. All rights reserved. 4 * Portions Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
5 * 5 *
6 * ***** BEGIN LICENSE BLOCK ***** 6 * ***** BEGIN LICENSE BLOCK *****
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions 9 * modification, are permitted provided that the following conditions
10 * are met: 10 * are met:
(...skipping 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after
1068 // TODO(darin): these navigation methods should be killed 1068 // TODO(darin): these navigation methods should be killed
1069 1069
1070 void WebViewImpl::StopLoading() { 1070 void WebViewImpl::StopLoading() {
1071 main_frame()->StopLoading(); 1071 main_frame()->StopLoading();
1072 } 1072 }
1073 1073
1074 void WebViewImpl::SetBackForwardListSize(int size) { 1074 void WebViewImpl::SetBackForwardListSize(int size) {
1075 page_->backForwardList()->setCapacity(size); 1075 page_->backForwardList()->setCapacity(size);
1076 } 1076 }
1077 1077
1078 void WebViewImpl::ClearFocusedNode() {
1079 // Get the last focused frame or the mainframe.
1080 RefPtr<Frame> frame = last_focused_frame_;
1081 if (!frame.get() && page_.get())
1082 frame = page_->mainFrame();
1083 if (!frame.get())
1084 return;
1085
1086 RefPtr<Document> document = frame->document();
1087 if (!document.get())
1088 return;
1089
1090 RefPtr<Node> old_focused_node = document->focusedNode();
1091
1092 // Clear the focused node.
1093 document->setFocusedNode(NULL);
1094
1095 if (!old_focused_node.get())
1096 return;
1097
1098 // If a text field has focus, we need to make sure the selection controller
1099 // knows to remove selection from it. Otherwise, the text field is still
1100 // processing keyboard events even though focus has been moved to the page and
1101 // keystrokes get eaten as a result.
1102 if (old_focused_node->hasTagName(HTMLNames::textareaTag) ||
1103 (old_focused_node->hasTagName(HTMLNames::inputTag) &&
1104 static_cast<HTMLInputElement*>(old_focused_node.get())->isTextField())) {
1105 // Clear the selection.
1106 SelectionController* selection = frame->selection();
1107 selection->clear();
1108 }
1109 }
1110
1078 void WebViewImpl::SetFocus(bool enable) { 1111 void WebViewImpl::SetFocus(bool enable) {
1079 if (enable) { 1112 if (enable) {
1080 // Getting the focused frame will have the side-effect of setting the main 1113 // Getting the focused frame will have the side-effect of setting the main
1081 // frame as the focused frame if it is not already focused. Otherwise, if 1114 // frame as the focused frame if it is not already focused. Otherwise, if
1082 // there is already a focused frame, then this does nothing. 1115 // there is already a focused frame, then this does nothing.
1083 GetFocusedFrame(); 1116 GetFocusedFrame();
1084 if (page_.get() && page_->mainFrame()) { 1117 if (page_.get() && page_->mainFrame()) {
1085 Frame* frame = page_->mainFrame(); 1118 Frame* frame = page_->mainFrame();
1086 if (!frame->selection()->isFocusedAndActive()) { 1119 if (!frame->selection()->isFocusedAndActive()) {
1087 // No one has focus yet, try to restore focus. 1120 // No one has focus yet, try to restore focus.
(...skipping 789 matching lines...) Expand 10 before | Expand all | Expand 10 after
1877 1910
1878 return document->focusedNode(); 1911 return document->focusedNode();
1879 } 1912 }
1880 1913
1881 HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) { 1914 HitTestResult WebViewImpl::HitTestResultForWindowPos(const IntPoint& pos) {
1882 IntPoint doc_point( 1915 IntPoint doc_point(
1883 page_->mainFrame()->view()->windowToContents(pos)); 1916 page_->mainFrame()->view()->windowToContents(pos));
1884 return page_->mainFrame()->eventHandler()-> 1917 return page_->mainFrame()->eventHandler()->
1885 hitTestResultAtPoint(doc_point, false); 1918 hitTestResultAtPoint(doc_point, false);
1886 } 1919 }
OLDNEW
« no previous file with comments | « webkit/glue/webview_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698