summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome_frame/chrome_active_document.cc8
-rw-r--r--chrome_frame/chrome_frame_activex.cc28
-rw-r--r--chrome_frame/chrome_frame_activex.h1
-rw-r--r--chrome_frame/chrome_frame_activex_base.h44
4 files changed, 47 insertions, 34 deletions
diff --git a/chrome_frame/chrome_active_document.cc b/chrome_frame/chrome_active_document.cc
index ad104c9..dfb1b03 100644
--- a/chrome_frame/chrome_active_document.cc
+++ b/chrome_frame/chrome_active_document.cc
@@ -399,12 +399,8 @@ void ChromeActiveDocument::OnAcceleratorPressed(int tab_handle,
if (IsFindAccelerator(accel_message)) {
// Handle the showing of the find dialog explicitly.
OnFindInPage();
- } else if (AllowFrameToTranslateAccelerator(accel_message) != S_OK) {
- DLOG(INFO) << "IE DID NOT handle accel key " << accel_message.wParam;
- TabProxy* tab = GetTabProxy();
- if (tab) {
- tab->ProcessUnhandledAccelerator(accel_message);
- }
+ } else {
+ Base::OnAcceleratorPressed(tab_handle, accel_message);
}
} else {
DLOG(INFO) << "IE handled accel key " << accel_message.wParam;
diff --git a/chrome_frame/chrome_frame_activex.cc b/chrome_frame/chrome_frame_activex.cc
index e58a961..9999fb7 100644
--- a/chrome_frame/chrome_frame_activex.cc
+++ b/chrome_frame/chrome_frame_activex.cc
@@ -51,32 +51,6 @@ LRESULT ChromeFrameActivex::OnCreate(UINT message, WPARAM wparam, LPARAM lparam,
return 0;
}
-void ChromeFrameActivex::OnAcceleratorPressed(int tab_handle,
- const MSG& accel_message) {
- DCHECK(m_spInPlaceSite != NULL);
- // Allow our host a chance to handle the accelerator.
- // This catches things like Ctrl+F, Ctrl+O etc, but not browser
- // accelerators such as F11, Ctrl+T etc.
- // (see AllowFrameToTranslateAccelerator for those).
- HRESULT hr = TranslateAccelerator(const_cast<MSG*>(&accel_message));
- if (hr != S_OK)
- hr = AllowFrameToTranslateAccelerator(accel_message);
-
- DLOG(INFO) << __FUNCTION__ << " browser response: "
- << StringPrintf("0x%08x", hr);
-
- // Last chance to handle the keystroke is to pass it to chromium.
- // We do this last partially because there's no way for us to tell if
- // chromium actually handled the keystroke, but also since the browser
- // should have first dibs anyway.
- if (hr != S_OK && automation_client_.get()) {
- TabProxy* tab = automation_client_->tab();
- if (tab) {
- tab->ProcessUnhandledAccelerator(accel_message);
- }
- }
-}
-
HRESULT ChromeFrameActivex::GetContainingDocument(IHTMLDocument2** doc) {
ScopedComPtr<IOleContainer> container;
HRESULT hr = m_spClientSite->GetContainer(container.Receive());
@@ -280,7 +254,7 @@ STDMETHODIMP ChromeFrameActivex::Load(IPropertyBag* bag, IErrorLog* error_log) {
const wchar_t g_activex_mixed_content_error[] = {
L"data:text/html,<html><body><b>ChromeFrame Security Error<br><br>"
L"Cannot navigate to HTTP url when document URL is HTTPS</body></html>"};
-
+
STDMETHODIMP ChromeFrameActivex::put_src(BSTR src) {
GURL document_url(GetDocumentUrl());
if (document_url.SchemeIsSecure()) {
diff --git a/chrome_frame/chrome_frame_activex.h b/chrome_frame/chrome_frame_activex.h
index 07b8122..d60b14b 100644
--- a/chrome_frame/chrome_frame_activex.h
+++ b/chrome_frame/chrome_frame_activex.h
@@ -80,7 +80,6 @@ END_MSG_MAP()
STDMETHOD(put_src)(BSTR src);
protected:
- virtual void OnAcceleratorPressed(int tab_handle, const MSG& accel_message);
virtual void OnLoad(int tab_handle, const GURL& url);
virtual void OnMessageFromChromeFrame(int tab_handle,
const std::string& message,
diff --git a/chrome_frame/chrome_frame_activex_base.h b/chrome_frame/chrome_frame_activex_base.h
index 7754bc0..70366d1 100644
--- a/chrome_frame/chrome_frame_activex_base.h
+++ b/chrome_frame/chrome_frame_activex_base.h
@@ -821,6 +821,50 @@ END_MSG_MAP()
return hr;
}
+ virtual void OnAcceleratorPressed(int tab_handle, const MSG& accel_message) {
+ DCHECK(m_spInPlaceSite != NULL);
+ // Allow our host a chance to handle the accelerator.
+ // This catches things like Ctrl+F, Ctrl+O etc, but not browser
+ // accelerators such as F11, Ctrl+T etc.
+ // (see AllowFrameToTranslateAccelerator for those).
+ HRESULT hr = TranslateAccelerator(const_cast<MSG*>(&accel_message));
+ if (hr != S_OK)
+ hr = AllowFrameToTranslateAccelerator(accel_message);
+
+ DLOG(INFO) << __FUNCTION__ << " browser response: "
+ << StringPrintf("0x%08x", hr);
+
+ if (hr != S_OK) {
+ // The WM_SYSCHAR message is not processed by the IOleControlSite
+ // implementation and the IBrowserService2::v_MayTranslateAccelerator
+ // implementation. We need to understand this better. That is for
+ // another day. For now we just post the WM_SYSCHAR message back to our
+ // parent which forwards it off to the frame. This should not cause major
+ // grief for Chrome as it does not need to handle WM_SYSCHAR accelerators
+ // when running in ChromeFrame mode.
+ // TODO(iyengar)
+ // Understand and fix WM_SYSCHAR handling
+ // We should probably unify the accelerator handling for the active
+ // document and the activex.
+ if (accel_message.message == WM_SYSCHAR) {
+ ::PostMessage(GetParent(), WM_SYSCHAR, accel_message.wParam,
+ accel_message.lParam);
+ return;
+ }
+ }
+
+ // Last chance to handle the keystroke is to pass it to chromium.
+ // We do this last partially because there's no way for us to tell if
+ // chromium actually handled the keystroke, but also since the browser
+ // should have first dibs anyway.
+ if (hr != S_OK && automation_client_.get()) {
+ TabProxy* tab = automation_client_->tab();
+ if (tab) {
+ tab->ProcessUnhandledAccelerator(accel_message);
+ }
+ }
+ }
+
protected:
ScopedBstr url_;
ScopedComPtr<IOleDocumentSite> doc_site_;