diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-24 16:02:44 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-09-24 16:02:44 +0000 |
commit | 5f8805140fb6b665c67284d8bb8d44d7a08f65f8 (patch) | |
tree | 01d9a9537546f3bd86e74aff6add85edf9b1e989 | |
parent | 8acaf58a26ccca92871da8122b08fdf5c17c062e (diff) | |
download | chromium_src-5f8805140fb6b665c67284d8bb8d44d7a08f65f8.zip chromium_src-5f8805140fb6b665c67284d8bb8d44d7a08f65f8.tar.gz chromium_src-5f8805140fb6b665c67284d8bb8d44d7a08f65f8.tar.bz2 |
Regression: Shift modifier on Find was reversed.
We were also not using GetKeyState correctly in win_util, as the documentation mentions. We should be looking at the high-order bit (&-ing with 0x8000, not 0x80).
BUG=22849TEST=Try to use Enter during FindInPage. Notice it should search forwards when Shift key is not pressed and backwards when Shift is pressed.
Review URL: http://codereview.chromium.org/218009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@27074 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | base/win_util.cc | 6 | ||||
-rw-r--r-- | chrome/browser/views/find_bar_view.cc | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/base/win_util.cc b/base/win_util.cc index c379703..37fc1ae 100644 --- a/base/win_util.cc +++ b/base/win_util.cc @@ -308,15 +308,15 @@ WNDPROC GetSuperclassWNDPROC(HWND window) { #pragma warning(pop) bool IsShiftPressed() { - return (::GetKeyState(VK_SHIFT) & 0x80) == 0x80; + return (::GetKeyState(VK_SHIFT) & 0x8000) == 0x8000; } bool IsCtrlPressed() { - return (::GetKeyState(VK_CONTROL) & 0x80) == 0x80; + return (::GetKeyState(VK_CONTROL) & 0x8000) == 0x8000; } bool IsAltPressed() { - return (::GetKeyState(VK_MENU) & 0x80) == 0x80; + return (::GetKeyState(VK_MENU) & 0x8000) == 0x8000; } std::wstring GetClassName(HWND window) { diff --git a/chrome/browser/views/find_bar_view.cc b/chrome/browser/views/find_bar_view.cc index af44846..48d2a06 100644 --- a/chrome/browser/views/find_bar_view.cc +++ b/chrome/browser/views/find_bar_view.cc @@ -478,7 +478,7 @@ bool FindBarView::HandleKeystroke(views::Textfield* sender, // Search forwards for enter, backwards for shift-enter. container_->GetFindBarController()->tab_contents()->StartFinding( find_string, - key.IsShiftHeld(), + !key.IsShiftHeld(), false); // Not case sensitive. } } |