summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/find_bar_view.cc
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-08 23:38:16 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-08 23:38:16 +0000
commit05d47875219edd6f25490d8a878021ff2d564170 (patch)
tree88fe8a3aaa158da3dd6acbb20258ab604a93ce56 /chrome/browser/views/find_bar_view.cc
parent43101c0334b3297868085e661a2e92f935434a5e (diff)
downloadchromium_src-05d47875219edd6f25490d8a878021ff2d564170.zip
chromium_src-05d47875219edd6f25490d8a878021ff2d564170.tar.gz
chromium_src-05d47875219edd6f25490d8a878021ff2d564170.tar.bz2
When the Find bar has focus it eats keypresses such as PageUp, PageDown and Up and Down arrow keys. It doesn't need to - instead the page should scroll even if focus is on the Find bar.
This patch forwards those selected keypresses to the page for its perusal. Known issues: Just like Firefox, the page doesn't scroll if it has frames. SONG=I like to fixit fixit. I like to fixit fixit. BUG=7079 TEST=Open FindInPage on a webpage that has a vertical scrollbar. Press Down, Up, PageDown and PageUp and the page should scroll accordingly. Make sure no ding is heard while doing so. Also make sure this works if focus is on a textfield/textarea when you press Ctrl+F. Review URL: http://codereview.chromium.org/62129 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/find_bar_view.cc')
-rw-r--r--chrome/browser/views/find_bar_view.cc15
1 files changed, 13 insertions, 2 deletions
diff --git a/chrome/browser/views/find_bar_view.cc b/chrome/browser/views/find_bar_view.cc
index 3930a7e..e5fcf4f 100644
--- a/chrome/browser/views/find_bar_view.cc
+++ b/chrome/browser/views/find_bar_view.cc
@@ -473,11 +473,11 @@ void FindBarView::ContentsChanged(views::TextField* sender,
}
}
-void FindBarView::HandleKeystroke(views::TextField* sender, UINT message,
+bool FindBarView::HandleKeystroke(views::TextField* sender, UINT message,
TCHAR key, UINT repeat_count, UINT flags) {
// If the dialog is not visible, there is no reason to process keyboard input.
if (!container_->IsVisible())
- return;
+ return false;
switch (key) {
case VK_RETURN: {
@@ -491,7 +491,18 @@ void FindBarView::HandleKeystroke(views::TextField* sender, UINT message,
}
break;
}
+#if defined(OS_WIN)
+ // TODO(port): Handle this for other platforms.
+ case VK_UP:
+ case VK_DOWN:
+ case VK_PRIOR: // Page up
+ case VK_NEXT: // Page down
+ container_->ForwardKeystrokeToWebpage(key);
+ return true; // Message has been handled. No further processing needed.
+#endif
}
+
+ return false;
}
void FindBarView::ResetMatchCountBackground() {