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-14 20:14:24 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-14 20:14:24 +0000
commit3db4da761ef830846c8a1f6b62e9c0d91392a28c (patch)
tree895f96d25f496e01d7d2e55a4933844a16a9e44f /chrome/browser/views/find_bar_view.cc
parent7bea1c588a1951e65f525cdab0e99c0839be691c (diff)
downloadchromium_src-3db4da761ef830846c8a1f6b62e9c0d91392a28c.zip
chromium_src-3db4da761ef830846c8a1f6b62e9c0d91392a28c.tar.gz
chromium_src-3db4da761ef830846c8a1f6b62e9c0d91392a28c.tar.bz2
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
Diffstat (limited to 'chrome/browser/views/find_bar_view.cc')
-rw-r--r--chrome/browser/views/find_bar_view.cc20
1 files changed, 6 insertions, 14 deletions
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;