| 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 // Implementation of ChromeActiveDocument | 5 // Implementation of ChromeActiveDocument |
| 6 #include "chrome_frame/chrome_active_document.h" | 6 #include "chrome_frame/chrome_active_document.h" |
| 7 | 7 |
| 8 #include <hlink.h> | 8 #include <hlink.h> |
| 9 #include <htiface.h> | 9 #include <htiface.h> |
| 10 #include <initguid.h> | 10 #include <initguid.h> |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 break; | 731 break; |
| 732 default: | 732 default: |
| 733 break; | 733 break; |
| 734 } | 734 } |
| 735 | 735 |
| 736 base::win::ScopedVariant secure_lock_status(lock_status); | 736 base::win::ScopedVariant secure_lock_status(lock_status); |
| 737 IEExec(&CGID_ShellDocView, INTERNAL_CMDID_SET_SSL_LOCK, | 737 IEExec(&CGID_ShellDocView, INTERNAL_CMDID_SET_SSL_LOCK, |
| 738 OLECMDEXECOPT_DODEFAULT, secure_lock_status.AsInput(), NULL); | 738 OLECMDEXECOPT_DODEFAULT, secure_lock_status.AsInput(), NULL); |
| 739 } | 739 } |
| 740 | 740 |
| 741 // A number of poorly written bho's crash in their event sink callbacks if |
| 742 // chrome frame is the currently loaded document. This is because they expect |
| 743 // chrome frame to implement interfaces like IHTMLDocument, etc. We patch the |
| 744 // event sink's of these bho's and don't invoke the event sink if chrome |
| 745 // frame is the currently loaded document. |
| 746 if (GetConfigBool(true, kEnableBuggyBhoIntercept)) { |
| 747 ScopedComPtr<IWebBrowser2> wb2; |
| 748 DoQueryService(SID_SWebBrowserApp, m_spClientSite, wb2.Receive()); |
| 749 if (wb2 && buggy_bho::BuggyBhoTls::GetInstance()) { |
| 750 buggy_bho::BuggyBhoTls::GetInstance()->PatchBuggyBHOs(wb2); |
| 751 } |
| 752 } |
| 753 |
| 741 // Ideally all navigations should come to Chrome Frame so that we can call | 754 // Ideally all navigations should come to Chrome Frame so that we can call |
| 742 // BeforeNavigate2 on installed BHOs and give them a chance to cancel the | 755 // BeforeNavigate2 on installed BHOs and give them a chance to cancel the |
| 743 // navigation. However, in practice what happens is as below: | 756 // navigation. However, in practice what happens is as below: |
| 744 // The very first navigation that happens in CF happens via a Load or a | 757 // The very first navigation that happens in CF happens via a Load or a |
| 745 // LoadHistory call. In this case, IE already has the correct information for | 758 // LoadHistory call. In this case, IE already has the correct information for |
| 746 // its travel log as well address bar. For other internal navigations (navs | 759 // its travel log as well address bar. For other internal navigations (navs |
| 747 // that only happen within Chrome such as anchor navigations) we need to | 760 // that only happen within Chrome such as anchor navigations) we need to |
| 748 // update IE's internal state after the fact. In the case of internal | 761 // update IE's internal state after the fact. In the case of internal |
| 749 // navigations, we notify the BHOs but ignore the should_cancel flag. | 762 // navigations, we notify the BHOs but ignore the should_cancel flag. |
| 750 | 763 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 761 bool is_internal_navigation = | 774 bool is_internal_navigation = |
| 762 IsNewNavigation(new_navigation_info, flags) || is_attach_external_tab_url; | 775 IsNewNavigation(new_navigation_info, flags) || is_attach_external_tab_url; |
| 763 | 776 |
| 764 if (new_navigation_info.url.is_valid()) | 777 if (new_navigation_info.url.is_valid()) |
| 765 url_.Allocate(UTF8ToWide(new_navigation_info.url.spec()).c_str()); | 778 url_.Allocate(UTF8ToWide(new_navigation_info.url.spec()).c_str()); |
| 766 | 779 |
| 767 if (is_internal_navigation) { | 780 if (is_internal_navigation) { |
| 768 ScopedComPtr<IDocObjectService> doc_object_svc; | 781 ScopedComPtr<IDocObjectService> doc_object_svc; |
| 769 ScopedComPtr<IWebBrowserEventsService> web_browser_events_svc; | 782 ScopedComPtr<IWebBrowserEventsService> web_browser_events_svc; |
| 770 | 783 |
| 771 buggy_bho::BuggyBhoTls bad_bho_tls; | |
| 772 if (GetConfigBool(true, kEnableBuggyBhoIntercept)) { | |
| 773 ScopedComPtr<IWebBrowser2> wb2; | |
| 774 DoQueryService(SID_SWebBrowserApp, m_spClientSite, wb2.Receive()); | |
| 775 if (wb2) { | |
| 776 buggy_bho::BuggyBhoTls::PatchBuggyBHOs(wb2); | |
| 777 } | |
| 778 } | |
| 779 | |
| 780 DoQueryService(__uuidof(web_browser_events_svc), m_spClientSite, | 784 DoQueryService(__uuidof(web_browser_events_svc), m_spClientSite, |
| 781 web_browser_events_svc.Receive()); | 785 web_browser_events_svc.Receive()); |
| 782 | 786 |
| 783 if (!web_browser_events_svc.get()) { | 787 if (!web_browser_events_svc.get()) { |
| 784 DoQueryService(SID_SShellBrowser, m_spClientSite, | 788 DoQueryService(SID_SShellBrowser, m_spClientSite, |
| 785 doc_object_svc.Receive()); | 789 doc_object_svc.Receive()); |
| 786 } | 790 } |
| 787 | 791 |
| 788 // web_browser_events_svc can be NULL on IE6. | 792 // web_browser_events_svc can be NULL on IE6. |
| 789 if (web_browser_events_svc) { | 793 if (web_browser_events_svc) { |
| (...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1394 return true; | 1398 return true; |
| 1395 | 1399 |
| 1396 if (new_navigation_info.url != navigation_info_->url) | 1400 if (new_navigation_info.url != navigation_info_->url) |
| 1397 return true; | 1401 return true; |
| 1398 | 1402 |
| 1399 if (new_navigation_info.referrer != navigation_info_->referrer) | 1403 if (new_navigation_info.referrer != navigation_info_->referrer) |
| 1400 return true; | 1404 return true; |
| 1401 | 1405 |
| 1402 return false; | 1406 return false; |
| 1403 } | 1407 } |
| OLD | NEW |