diff options
-rw-r--r-- | chrome/browser/external_tab_container.cc | 35 | ||||
-rw-r--r-- | chrome_frame/chrome_frame_activex_base.h | 9 |
2 files changed, 17 insertions, 27 deletions
diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index 9d0d089..9e098fd 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -678,30 +678,17 @@ bool ExternalTabContainer::ProcessUnhandledKeyStroke(HWND window, return false; } - 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 - // to handle. If the host does not handle this accelerator, it will reflect - // the accelerator back to us via the ProcessUnhandledAccelerator method. - MSG msg = {0}; - msg.hwnd = window; - msg.message = message; - msg.wParam = wparam; - msg.lParam = lparam; - automation_->Send(new AutomationMsg_HandleAccelerator(0, tab_handle_, msg)); - return true; - } - - return false; + // Send this keystroke to the external host as it could be processed as an + // accelerator there. If the host does not handle this accelerator, it will + // reflect the accelerator back to us via the ProcessUnhandledAccelerator + // method. + MSG msg = {0}; + msg.hwnd = window; + msg.message = message; + msg.wParam = wparam; + msg.lParam = lparam; + automation_->Send(new AutomationMsg_HandleAccelerator(0, tab_handle_, msg)); + return true; } bool ExternalTabContainer::InitNavigationInfo(IPC::NavigationInfo* nav_info, diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h index 8494f83..6d27604 100644 --- a/chrome_frame/chrome_frame_activex_base.h +++ b/chrome_frame/chrome_frame_activex_base.h @@ -971,11 +971,14 @@ END_MSG_MAP() // fall back on its default behavior. Instead we give IE a chance to // handle the shortcut here. + MSG accel_message = msg; + accel_message.hwnd = ::GetParent(m_hWnd); + HRESULT hr = S_FALSE; ScopedComPtr<IBrowserService2> bs2; if (S_OK == DoQueryService(SID_STopLevelBrowser, m_spInPlaceSite, bs2.Receive()) && bs2.get()) { - hr = bs2->v_MayTranslateAccelerator(const_cast<MSG*>(&msg)); + hr = bs2->v_MayTranslateAccelerator(&accel_message); } else { // IE8 doesn't support IBrowserService2 unless you enable a special, // undocumented flag with CoInternetSetFeatureEnabled and even then, @@ -999,8 +1002,8 @@ END_MSG_MAP() // to our parent window and IE will pick it up if it's an // accelerator. We won't know for sure if the browser handled the // keystroke or not. - ::PostMessage(::GetParent(m_hWnd), msg.message, msg.wParam, - msg.lParam); + ::PostMessage(accel_message.hwnd, accel_message.message, + accel_message.wParam, accel_message.lParam); } return hr; |