diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-12 21:55:48 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-12 21:55:48 +0000 |
commit | 01dba671701e7bb89f272084296fcca77b2f66cb (patch) | |
tree | 4dd852f1471ba71684a0e731dabcfd1a0941e326 /chrome_frame/chrome_frame_activex_base.h | |
parent | 3b1c18191d41eac0a551b3009269a259757ca070 (diff) | |
download | chromium_src-01dba671701e7bb89f272084296fcca77b2f66cb.zip chromium_src-01dba671701e7bb89f272084296fcca77b2f66cb.tar.gz chromium_src-01dba671701e7bb89f272084296fcca77b2f66cb.tar.bz2 |
Fix an IE7 crash caused when ChromeFrame would pass keystrokes to be processed as accelerators. The crash
occured in the call to IBrowserService2::v_MayTranslateAccelerator which takes in a MSG as a parameter.
This message contains the hwnd of the ChromeRenderWidgetHost. Eventually this method tries to DispatchMessage
this message to the same hwnd, which causes a crash possibly because this window is in a different process.
Fix is to switch the hwnd to the parent of the ChromeFrame ActiveX.
The other fix is to send over all keystrokes from the ExternalTabContainer instead of filtering them. With
this fix in BackSpace works correctly in IE7, i.e. it goes back in history. However the other keystrokes like
Shift Backspace, etc don't work. They are probably processed by mshtml. It appears that we may have to
prcess these accelerators in our active document and do the right thing there. That in a separate CL.
Fixes bug http://code.google.com/p/chromium/issues/detail?id=35355
Bug=35355
Review URL: http://codereview.chromium.org/603041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38962 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/chrome_frame_activex_base.h')
-rw-r--r-- | chrome_frame/chrome_frame_activex_base.h | 9 |
1 files changed, 6 insertions, 3 deletions
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; |