diff options
author | tommi@google.com <tommi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-02 16:45:27 +0000 |
---|---|---|
committer | tommi@google.com <tommi@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-02 16:45:27 +0000 |
commit | 060254cd407f502d2e04000c9a59269c14593627 (patch) | |
tree | cd2672304bfd316eef5b9f2adad8bc8d65a7a9aa /chrome/browser/external_tab_container.cc | |
parent | 48b47ffa7fc481b9aa281d93f9bfd88915f70e08 (diff) | |
download | chromium_src-060254cd407f502d2e04000c9a59269c14593627.zip chromium_src-060254cd407f502d2e04000c9a59269c14593627.tar.gz chromium_src-060254cd407f502d2e04000c9a59269c14593627.tar.bz2 |
Allowing the client to handle escape and keyup events.
Review URL: http://codereview.chromium.org/99293
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15142 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/external_tab_container.cc')
-rw-r--r-- | chrome/browser/external_tab_container.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index e89de09..322db1f 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -339,8 +339,8 @@ bool ExternalTabContainer::IsActive() const { return win_util::IsWindowActive(*this); } -bool ExternalTabContainer::ProcessKeyDown(HWND window, UINT message, - WPARAM wparam, LPARAM lparam) { +bool ExternalTabContainer::ProcessKeyStroke(HWND window, UINT message, + WPARAM wparam, LPARAM lparam) { if (!automation_) { return false; } @@ -349,9 +349,16 @@ bool ExternalTabContainer::ProcessKeyDown(HWND window, UINT message, // Ctrl-Shift-Tab) return false; } - int flags = HIWORD(lparam); - if ((flags & KF_EXTENDED) || (flags & KF_ALTDOWN) || - (wparam >= VK_F1 && wparam <= VK_F24) || + + unsigned int flags = HIWORD(lparam); + bool alt = (flags & KF_ALTDOWN) != 0; + if (!alt && (message == WM_SYSKEYUP || message == WM_KEYUP)) { + // In case the Alt key is being released. + alt = (wparam == VK_MENU); + } + + if ((flags & KF_EXTENDED) || alt || (wparam >= VK_F1 && wparam <= VK_F24) || + wparam == VK_ESCAPE || wparam == VK_RETURN || win_util::IsShiftPressed() || win_util::IsCtrlPressed()) { // If this is an extended key or if one or more of Alt, Shift and Control // are pressed, this might be an accelerator that the external host wants @@ -365,6 +372,7 @@ bool ExternalTabContainer::ProcessKeyDown(HWND window, UINT message, automation_->Send(new AutomationMsg_HandleAccelerator(0, msg)); return true; } + return false; } |