Chromium Code Reviews| Index: chrome_frame/utils.cc |
| =================================================================== |
| --- chrome_frame/utils.cc (revision 74374) |
| +++ chrome_frame/utils.cc (working copy) |
| @@ -33,6 +33,7 @@ |
| #include "chrome_frame/navigation_constraints.h" |
| #include "chrome_frame/policy_settings.h" |
| #include "chrome_frame/simple_resource_loader.h" |
| +#include "chrome_tab.h" // NOLINT |
|
tommi (sloooow) - chröme
2011/02/11 19:34:15
move to the bottom? (plus an empty line before)
ananta
2011/02/11 21:19:35
Done.
|
| #include "googleurl/src/gurl.h" |
| #include "googleurl/src/url_canon.h" |
| #include "grit/chromium_strings.h" |
| @@ -1583,3 +1584,21 @@ |
| 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(); |
|
tommi (sloooow) - chröme
2011/02/11 19:34:15
instead of !! use
return chrome_frame.get() != NUL
ananta
2011/02/11 21:19:35
Done.
|
| + } |
| + return false; |
| +} |
| + |