diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-12 14:38:14 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-12 14:38:14 +0000 |
commit | 5843d2a683bb4e487b23543899cd96fb6669d9fb (patch) | |
tree | f7ab77377a5be63fd56cb6826b1e32207c73dc45 | |
parent | 598ad335913945b46c1e1350b436ac7d469fc2e9 (diff) | |
download | chromium_src-5843d2a683bb4e487b23543899cd96fb6669d9fb.zip chromium_src-5843d2a683bb4e487b23543899cd96fb6669d9fb.tar.gz chromium_src-5843d2a683bb4e487b23543899cd96fb6669d9fb.tar.bz2 |
Querying for one more interface to handle IE8 on XP case. This is what we were hitting on the builder.
R=ananta
BUG=none
TEST=Run all unit tests. This is a second attempt to switch to onhttpequiv.
Review URL: http://codereview.chromium.org/543017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36009 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome_frame/bho.cc | 2 | ||||
-rw-r--r-- | chrome_frame/extra_system_apis.h | 30 | ||||
-rw-r--r-- | chrome_frame/utils.cc | 39 |
3 files changed, 32 insertions, 39 deletions
diff --git a/chrome_frame/bho.cc b/chrome_frame/bho.cc index 4cb41af..cb7128a 100644 --- a/chrome_frame/bho.cc +++ b/chrome_frame/bho.cc @@ -245,7 +245,7 @@ bool PatchHelper::InitializeAndPatchProtocolsIfNeeded() { HttpNegotiatePatch::Initialize(); - bool patch_protocol = GetConfigBool(true, kPatchProtocols); + bool patch_protocol = GetConfigBool(false, kPatchProtocols); if (patch_protocol) { ProtocolSinkWrap::PatchProtocolHandlers(); state_ = PATCH_PROTOCOL; diff --git a/chrome_frame/extra_system_apis.h b/chrome_frame/extra_system_apis.h index 724b0c8f..c951c10 100644 --- a/chrome_frame/extra_system_apis.h +++ b/chrome_frame/extra_system_apis.h @@ -48,37 +48,15 @@ IWebBrowserPriv : public IUnknown { STDMETHOD(OnClose)(); }; -// Web browser methods that are used by MSHTML when navigating or -// initiating downloads. IE7. -class __declspec(uuid("{1AF32B6C-A3BA-48B9-B24E-8AA9C41F6ECD}")) -IWebBrowserPriv2IE7 : public IUnknown { - public: - STDMETHOD(NavigateWithBindCtx2)(IUri* uri, VARIANT* flags, - VARIANT* target_frame, VARIANT* post_data, - VARIANT* headers, IBindCtx* bind_ctx, - LPOLESTR url_fragment); - STDMETHOD(SetBrowserFrameOptions)(DWORD opt1, DWORD opt2); - STDMETHOD(DetachConnectionPoints)(); -}; - -// Web browser methods that are used by MSHTML when navigating or -// initiating downloads. IE8 uses IID {3ED72303-6FFC-4214-BA90-FAF1862DEC8A} -// whereas the IID is {1AF32B6C-A3BA-48B9-B24E-8AA9C41F6ECD} in IE7 -class __declspec(uuid("{3ED72303-6FFC-4214-BA90-FAF1862DEC8A}")) -IWebBrowserPriv2IE8 : public IUnknown { +// The common denominator for IE7 and IE8 versions. There's no specific IID +// here since all apply. We use this interface for simplicities sake as all we +// want to do is invoke the NavigateWithBindCtx2 method. +class IWebBrowserPriv2Common : public IUnknown { public: STDMETHOD(NavigateWithBindCtx2)(IUri* uri, VARIANT* flags, VARIANT* target_frame, VARIANT* post_data, VARIANT* headers, IBindCtx* bind_ctx, LPOLESTR url_fragment); - STDMETHOD(SetBrowserFrameOptions)(DWORD opt1, DWORD opt2); - STDMETHOD(DetachConnectionPoints)(); - STDMETHOD(GetProcessId)(DWORD* pid); - STDMETHOD(CompatAttachEditEvents)(); - STDMETHOD(HandleOpenOptions)(IUnknown* obj, BSTR bstr, int options); - STDMETHOD(SetSearchTerm)(BSTR term); - STDMETHOD(GetSearchTerm)(BSTR* term); - STDMETHOD(GetCurrentDocument)(IDispatch** doc); }; // This interface is used to call FireBeforeNavigate with additional diff --git a/chrome_frame/utils.cc b/chrome_frame/utils.cc index 88b46c5..af85cb4 100644 --- a/chrome_frame/utils.cc +++ b/chrome_frame/utils.cc @@ -53,6 +53,18 @@ const wchar_t kChromeAttachExternalTabPrefix[] = L"attach_external_tab"; // are handled by the chrome test crash server. const wchar_t kChromeFrameHeadlessMode[] = L"ChromeFrameHeadlessMode"; +// {1AF32B6C-A3BA-48B9-B24E-8AA9C41F6ECD} +static const IID IID_IWebBrowserPriv2IE7 = { 0x1AF32B6C, 0xA3BA, 0x48B9, + { 0xB2, 0x4E, 0x8A, 0xA9, 0xC4, 0x1F, 0x6E, 0xCD } }; + +// {3ED72303-6FFC-4214-BA90-FAF1862DEC8A} +static const IID IID_IWebBrowserPriv2IE8 = { 0x3ED72303, 0x6FFC, 0x4214, + { 0xBA, 0x90, 0xFA, 0xF1, 0x86, 0x2D, 0xEC, 0x8A } }; + +// {486F6159-9F3F-4827-82D4-283CEF397733} +static const IID IID_IWebBrowserPriv2IE8XP = { 0x486F6159, 0x9F3F, 0x4827, + { 0x82, 0xD4, 0x28, 0x3C, 0xEF, 0x39, 0x77, 0x33 } }; + namespace { // A flag used to signal when an active browser instance on the current thread @@ -657,24 +669,27 @@ HRESULT NavigateBrowserToMoniker(IUnknown* browser, IMoniker* moniker, if (uri_container) { // IE7 and IE8. - ScopedComPtr<IWebBrowserPriv2IE7> browser_priv2_ie7; - ScopedComPtr<IWebBrowserPriv2IE8> browser_priv2_ie8; - IWebBrowserPriv2IE7* common_browser_priv2 = NULL; - if (SUCCEEDED(hr = browser_priv2_ie7.QueryFrom(web_browser2))) { - common_browser_priv2 = browser_priv2_ie7; - } else if (SUCCEEDED(hr = browser_priv2_ie8.QueryFrom(web_browser2))) { - common_browser_priv2 = - reinterpret_cast<IWebBrowserPriv2IE7*>(browser_priv2_ie8.get()); + const IID* interface_ids[] = { + &IID_IWebBrowserPriv2IE7, + &IID_IWebBrowserPriv2IE8, + &IID_IWebBrowserPriv2IE8XP, + }; + + ScopedComPtr<IWebBrowserPriv2Common, NULL> browser_priv2; + for (int i = 0; i < arraysize(interface_ids) && browser_priv2 == NULL; + ++i) { + hr = web_browser2.QueryInterface(*interface_ids[i], + reinterpret_cast<void**>(browser_priv2.Receive())); } - DCHECK(common_browser_priv2); + DCHECK(browser_priv2); - if (common_browser_priv2) { + if (browser_priv2) { ScopedComPtr<IUri> uri_obj; uri_container->GetIUri(uri_obj.Receive()); DCHECK(uri_obj); - hr = common_browser_priv2->NavigateWithBindCtx2(uri_obj, NULL, NULL, NULL, - NULL, bind_ctx, NULL); + hr = browser_priv2->NavigateWithBindCtx2(uri_obj, NULL, NULL, NULL, NULL, + bind_ctx, NULL); DLOG_IF(WARNING, FAILED(hr)) << StringPrintf(L"NavigateWithBindCtx2 0x%08X", hr); } |