Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome_frame/utils.h" | 5 #include "chrome_frame/utils.h" |
| 6 | 6 |
| 7 #include <htiframe.h> | 7 #include <htiframe.h> |
| 8 #include <mshtml.h> | 8 #include <mshtml.h> |
| 9 #include <shlobj.h> | 9 #include <shlobj.h> |
| 10 | 10 |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 26 #include "base/win/scoped_comptr.h" | 26 #include "base/win/scoped_comptr.h" |
| 27 #include "base/win/scoped_variant.h" | 27 #include "base/win/scoped_variant.h" |
| 28 #include "chrome/common/chrome_paths_internal.h" | 28 #include "chrome/common/chrome_paths_internal.h" |
| 29 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
| 30 #include "chrome/installer/util/chrome_frame_distribution.h" | 30 #include "chrome/installer/util/chrome_frame_distribution.h" |
| 31 #include "chrome_frame/extra_system_apis.h" | 31 #include "chrome_frame/extra_system_apis.h" |
| 32 #include "chrome_frame/html_utils.h" | 32 #include "chrome_frame/html_utils.h" |
| 33 #include "chrome_frame/navigation_constraints.h" | 33 #include "chrome_frame/navigation_constraints.h" |
| 34 #include "chrome_frame/policy_settings.h" | 34 #include "chrome_frame/policy_settings.h" |
| 35 #include "chrome_frame/simple_resource_loader.h" | 35 #include "chrome_frame/simple_resource_loader.h" |
| 36 #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.
| |
| 36 #include "googleurl/src/gurl.h" | 37 #include "googleurl/src/gurl.h" |
| 37 #include "googleurl/src/url_canon.h" | 38 #include "googleurl/src/url_canon.h" |
| 38 #include "grit/chromium_strings.h" | 39 #include "grit/chromium_strings.h" |
| 39 #include "net/base/escape.h" | 40 #include "net/base/escape.h" |
| 40 #include "net/http/http_util.h" | 41 #include "net/http/http_util.h" |
| 41 | 42 |
| 42 using base::win::RegKey; | 43 using base::win::RegKey; |
| 43 using base::win::ScopedComPtr; | 44 using base::win::ScopedComPtr; |
| 44 | 45 |
| 45 // Note that these values are all lower case and are compared to | 46 // Note that these values are all lower case and are compared to |
| (...skipping 1530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1576 ++url_list; | 1577 ++url_list; |
| 1577 } | 1578 } |
| 1578 } | 1579 } |
| 1579 | 1580 |
| 1580 std::wstring GetCurrentModuleVersion() { | 1581 std::wstring GetCurrentModuleVersion() { |
| 1581 scoped_ptr<FileVersionInfo> module_version_info( | 1582 scoped_ptr<FileVersionInfo> module_version_info( |
| 1582 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); | 1583 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); |
| 1583 DCHECK(module_version_info.get() != NULL); | 1584 DCHECK(module_version_info.get() != NULL); |
| 1584 return module_version_info->file_version(); | 1585 return module_version_info->file_version(); |
| 1585 } | 1586 } |
| 1587 | |
| 1588 bool IsChromeFrameDocument(IWebBrowser2* web_browser) { | |
| 1589 if (!web_browser) | |
| 1590 return false; | |
| 1591 | |
| 1592 ScopedComPtr<IDispatch> doc; | |
| 1593 web_browser->get_Document(doc.Receive()); | |
| 1594 if (doc) { | |
| 1595 // Detect if CF is rendering based on whether the document is a | |
| 1596 // ChromeActiveDocument. Detecting based on hwnd is problematic as | |
| 1597 // the CF Active Document window may not have been created yet. | |
| 1598 ScopedComPtr<IChromeFrame> chrome_frame; | |
| 1599 chrome_frame.QueryFrom(doc); | |
| 1600 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.
| |
| 1601 } | |
| 1602 return false; | |
| 1603 } | |
| 1604 | |
| OLD | NEW |