From 3db4da761ef830846c8a1f6b62e9c0d91392a28c Mon Sep 17 00:00:00 2001 From: "finnur@chromium.org" Date: Tue, 14 Apr 2009 20:14:24 +0000 Subject: A fix for the Find box forwarding scroll messages to the page when it shouldn't. TEST=Open Find on a page with scrollbars, type in 'nomatch', scroll to the middle of the page, set the cursor at the end of the Find text field and add '!', '(' and ')' to the search string. Make sure the page doesn't scroll. BUG=10509 Review URL: http://codereview.chromium.org/67135 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13696 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/views/find_bar_view.cc | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'chrome/browser/views/find_bar_view.cc') diff --git a/chrome/browser/views/find_bar_view.cc b/chrome/browser/views/find_bar_view.cc index 888c4f6..f348c29 100644 --- a/chrome/browser/views/find_bar_view.cc +++ b/chrome/browser/views/find_bar_view.cc @@ -479,6 +479,12 @@ bool FindBarView::HandleKeystroke(views::TextField* sender, UINT message, if (!container_->IsVisible()) return false; + // TODO(port): Handle this for other platforms. + #if defined(OS_WIN) + if (container_->MaybeForwardKeystrokeToWebpage(message, key, flags)) + return true; // Handled, we are done! + #endif + switch (key) { case VK_RETURN: { // Pressing Return/Enter starts the search (unless text box is empty). @@ -491,20 +497,6 @@ bool FindBarView::HandleKeystroke(views::TextField* sender, UINT message, } break; } -#if defined(OS_WIN) - // TODO(port): Handle this for other platforms. - case VK_HOME: - case VK_END: - // Ctrl+Home and Ctrl+End should be forwarded to the page. - if (GetKeyState(VK_CONTROL) >= 0) - return false; // Ctrl not pressed: Abort. Otherwise fall through. - 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; -- cgit v1.1