diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-11 23:12:35 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-11 23:12:35 +0000 |
commit | a17930d85c1a30bcb97c793ba08d2e6ea019deb6 (patch) | |
tree | cfb4f8917856c46f038ff5a1420ebce4c9f53526 /chrome_frame/utils.cc | |
parent | d37d93b349a3e5090ad2d7ea6ed44913384ed849 (diff) | |
download | chromium_src-a17930d85c1a30bcb97c793ba08d2e6ea019deb6.zip chromium_src-a17930d85c1a30bcb97c793ba08d2e6ea019deb6.tar.gz chromium_src-a17930d85c1a30bcb97c793ba08d2e6ea019deb6.tar.bz2 |
A number of poorly written IE BHO's crash IE if ChromeFrame is the currently loaded document.
This is because they expect ChromeFrame to implement interfaces like IHTMLDocument2 on the same
lines as regular IE documents. Currently in ChromeFrame we patch the invoke methods of these
BHO's prior to firing navigation events from ChromeFrame. However this is not enough as
these objects also crash for regular navigation events fired from IE when ChromeFrame is loaded.
We now don't fire navigation events for buggy BHO's if ChromeFrame is the current document.
The BuggyBho handler instance is now created once for the thread. We patch when we receive
navigation notifications from Chrome as before. When we receive a notification
on our patched event sink we check if CF is loaded and if yes skip the call.
Added helpers to chrome frame utils to check if CF is loaded in the current web browser instance.
BUG=55932
TEST=none
Review URL: http://codereview.chromium.org/6493002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@74691 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/utils.cc')
-rw-r--r-- | chrome_frame/utils.cc | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index 210d6488..049294c 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -39,6 +39,8 @@ #include "net/base/escape.h" #include "net/http/http_util.h" +#include "chrome_tab.h" // NOLINT + using base::win::RegKey; using base::win::ScopedComPtr; @@ -1583,3 +1585,21 @@ std::wstring GetCurrentModuleVersion() { DCHECK(module_version_info.get() != NULL); return module_version_info->file_version(); } + +bool IsChromeFrameDocument(IWebBrowser2* web_browser) { + if (!web_browser) + return false; + + ScopedComPtr<IDispatch> doc; + web_browser->get_Document(doc.Receive()); + if (doc) { + // Detect if CF is rendering based on whether the document is a + // ChromeActiveDocument. Detecting based on hwnd is problematic as + // the CF Active Document window may not have been created yet. + ScopedComPtr<IChromeFrame> chrome_frame; + chrome_frame.QueryFrom(doc); + return chrome_frame.get() != NULL; + } + return false; +} + |