diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-18 22:00:13 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-18 22:00:13 +0000 |
commit | d74b1d15a1bb6c0b476a2c3456e05bc143057804 (patch) | |
tree | db6a0ff26f6f692983ce330ae3527550bd7acbe1 /chrome_frame | |
parent | 8425adc0c9cd53f6e590825486276b05f09cf90b (diff) | |
download | chromium_src-d74b1d15a1bb6c0b476a2c3456e05bc143057804.zip chromium_src-d74b1d15a1bb6c0b476a2c3456e05bc143057804.tar.gz chromium_src-d74b1d15a1bb6c0b476a2c3456e05bc143057804.tar.bz2 |
Improved compatibility support for IE8.
1) We no longer add a user agent to requests that do not already have one.
This will result in the correct user agent header being applied but it will not have the chromeframe tag.
Requests that will be affected include requests from other plugins and XHR but not top level requests.
2) Requests from Chrome Frame will always have the native user agent applied regardless of compatibility settings.
This means that in IE8, you will always see CF requests with MSIE 8.0 even though the target site is otherwise configured to run in IE7 compatibility.
TEST=Make sure all CF websites continue to work properly. Also, turn on IE7 compatibility mode for some websites (e.g. wave, vimeo) and check if the user agent sent to those sites contains "MSIE 7.0" for pages that are not rendered in CF. Pages rendered in CF should always have the IE8 header with the possible exception of the very first request if that request was issued by mshtml.
BUG=28816
Review URL: http://codereview.chromium.org/1521037
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44897 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/http_negotiate.cc | 18 | ||||
-rw-r--r-- | chrome_frame/urlmon_moniker.cc | 2 | ||||
-rw-r--r-- | chrome_frame/urlmon_moniker.h | 2 | ||||
-rw-r--r-- | chrome_frame/urlmon_url_request.cc | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/chrome_frame/http_negotiate.cc b/chrome_frame/http_negotiate.cc index a95255a..cc9606e 100644 --- a/chrome_frame/http_negotiate.cc +++ b/chrome_frame/http_negotiate.cc @@ -258,14 +258,6 @@ HRESULT HttpNegotiatePatch::BeginningTransaction( user_agent_value = original_it.values(); } - // Use the default one if none was provided. - if (user_agent_value.empty()) - user_agent_value = http_utils::GetDefaultUserAgent(); - - // Now add chromeframe to it. - user_agent_value = http_utils::AddChromeFrameToUserAgentValue( - user_agent_value); - // Build new headers, skip the existing user agent value from // existing headers. std::string new_headers; @@ -277,11 +269,17 @@ HRESULT HttpNegotiatePatch::BeginningTransaction( } } - new_headers += "User-Agent: " + user_agent_value; - new_headers += "\r\n\r\n"; + if (!user_agent_value.empty()) { + // Now add chromeframe to the user agent. + user_agent_value = http_utils::AddChromeFrameToUserAgentValue( + user_agent_value); + new_headers += "User-Agent: " + user_agent_value; + new_headers += "\r\n\r\n"; + } if (*additional_headers) ::CoTaskMemFree(*additional_headers); + *additional_headers = reinterpret_cast<wchar_t*>(::CoTaskMemAlloc( (new_headers.length() + 1) * sizeof(wchar_t))); lstrcpyW(*additional_headers, ASCIIToWide(new_headers).c_str()); diff --git a/chrome_frame/urlmon_moniker.cc b/chrome_frame/urlmon_moniker.cc index 4713da0..5b580b7 100644 --- a/chrome_frame/urlmon_moniker.cc +++ b/chrome_frame/urlmon_moniker.cc @@ -141,7 +141,7 @@ bool ShouldWrapCallback(IMoniker* moniker, REFIID iid, IBindCtx* bind_context) { NavigationManager* mgr = NavigationManager::GetThreadInstance(); if (!mgr) { DLOG(INFO) << __FUNCTION__ << " Url: " << url << - " No navitagion manager to wrap"; + " No navigation manager to wrap"; return false; } diff --git a/chrome_frame/urlmon_moniker.h b/chrome_frame/urlmon_moniker.h index 1f168a8..402c386 100644 --- a/chrome_frame/urlmon_moniker.h +++ b/chrome_frame/urlmon_moniker.h @@ -166,6 +166,4 @@ class MonikerPatch { }; -extern wchar_t* kChromeRequestParam; - #endif // CHROME_FRAME_URLMON_MONIKER_H_ diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc index 3c38b0c..793cb11 100644 --- a/chrome_frame/urlmon_url_request.cc +++ b/chrome_frame/urlmon_url_request.cc @@ -483,6 +483,10 @@ STDMETHODIMP UrlmonUrlRequest::BeginningTransaction(const wchar_t* url, new_headers += StringPrintf("Referer: %s\r\n", referrer().c_str()); } + // Remember to add the user agent header. + new_headers += http_utils::GetDefaultUserAgentHeaderWithCFTag(); + new_headers += "\r\n"; + if (!new_headers.empty()) { *additional_headers = reinterpret_cast<wchar_t*>( CoTaskMemAlloc((new_headers.size() + 1) * sizeof(wchar_t))); |