| 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 21 matching lines...) Expand all Loading... |
| 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 "googleurl/src/gurl.h" | 36 #include "googleurl/src/gurl.h" |
| 37 #include "googleurl/src/url_canon.h" | 37 #include "googleurl/src/url_canon.h" |
| 38 #include "grit/chromium_strings.h" | 38 #include "grit/chromium_strings.h" |
| 39 #include "net/base/escape.h" | 39 #include "net/base/escape.h" |
| 40 #include "net/http/http_util.h" | 40 #include "net/http/http_util.h" |
| 41 | 41 |
| 42 #include "chrome_tab.h" // NOLINT |
| 43 |
| 42 using base::win::RegKey; | 44 using base::win::RegKey; |
| 43 using base::win::ScopedComPtr; | 45 using base::win::ScopedComPtr; |
| 44 | 46 |
| 45 // Note that these values are all lower case and are compared to | 47 // Note that these values are all lower case and are compared to |
| 46 // lower-case-transformed values. | 48 // lower-case-transformed values. |
| 47 const wchar_t kMetaTag[] = L"meta"; | 49 const wchar_t kMetaTag[] = L"meta"; |
| 48 const wchar_t kHttpEquivAttribName[] = L"http-equiv"; | 50 const wchar_t kHttpEquivAttribName[] = L"http-equiv"; |
| 49 const wchar_t kContentAttribName[] = L"content"; | 51 const wchar_t kContentAttribName[] = L"content"; |
| 50 const wchar_t kXUACompatValue[] = L"x-ua-compatible"; | 52 const wchar_t kXUACompatValue[] = L"x-ua-compatible"; |
| 51 const wchar_t kBodyTag[] = L"body"; | 53 const wchar_t kBodyTag[] = L"body"; |
| (...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1576 ++url_list; | 1578 ++url_list; |
| 1577 } | 1579 } |
| 1578 } | 1580 } |
| 1579 | 1581 |
| 1580 std::wstring GetCurrentModuleVersion() { | 1582 std::wstring GetCurrentModuleVersion() { |
| 1581 scoped_ptr<FileVersionInfo> module_version_info( | 1583 scoped_ptr<FileVersionInfo> module_version_info( |
| 1582 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); | 1584 FileVersionInfo::CreateFileVersionInfoForCurrentModule()); |
| 1583 DCHECK(module_version_info.get() != NULL); | 1585 DCHECK(module_version_info.get() != NULL); |
| 1584 return module_version_info->file_version(); | 1586 return module_version_info->file_version(); |
| 1585 } | 1587 } |
| 1588 |
| 1589 bool IsChromeFrameDocument(IWebBrowser2* web_browser) { |
| 1590 if (!web_browser) |
| 1591 return false; |
| 1592 |
| 1593 ScopedComPtr<IDispatch> doc; |
| 1594 web_browser->get_Document(doc.Receive()); |
| 1595 if (doc) { |
| 1596 // Detect if CF is rendering based on whether the document is a |
| 1597 // ChromeActiveDocument. Detecting based on hwnd is problematic as |
| 1598 // the CF Active Document window may not have been created yet. |
| 1599 ScopedComPtr<IChromeFrame> chrome_frame; |
| 1600 chrome_frame.QueryFrom(doc); |
| 1601 return chrome_frame.get() != NULL; |
| 1602 } |
| 1603 return false; |
| 1604 } |
| 1605 |
| OLD | NEW |