summaryrefslogtreecommitdiffstats
path: root/chrome_frame/http_negotiate.cc
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-20 00:42:55 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-20 00:42:55 +0000
commit845f6bf4e89b593d93c425a9f2382c71383b4dd5 (patch)
tree2fb7499f5bf7efb21536a2a11d9cd345040a7e61 /chrome_frame/http_negotiate.cc
parent0942444abdf2cae88ea5816f563fd55c5cfbde23 (diff)
downloadchromium_src-845f6bf4e89b593d93c425a9f2382c71383b4dd5.zip
chromium_src-845f6bf4e89b593d93c425a9f2382c71383b4dd5.tar.gz
chromium_src-845f6bf4e89b593d93c425a9f2382c71383b4dd5.tar.bz2
Enable the ChromeFrame IHttpNegotiate patch for all IE versions. Ensure that Chrome's UA
is sent out from IE in case Chrome is the default renderer for IE. Fixes bug http://code.google.com/p/chromium/issues/detail?id=70138 BUG=70138 TEST=As described in the bug at this point. Unit tests for this will follow. Review URL: http://codereview.chromium.org/6279006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71887 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/http_negotiate.cc')
-rw-r--r--chrome_frame/http_negotiate.cc15
1 files changed, 12 insertions, 3 deletions
diff --git a/chrome_frame/http_negotiate.cc b/chrome_frame/http_negotiate.cc
index 370c52a..f1a1989 100644
--- a/chrome_frame/http_negotiate.cc
+++ b/chrome_frame/http_negotiate.cc
@@ -231,10 +231,19 @@ HRESULT HttpNegotiatePatch::BeginningTransaction(
return hr;
}
if (modify_user_agent_) {
- std::string updated(AppendCFUserAgentString(headers, *additional_headers));
+ std::string updated_headers;
+ if (IsGcfDefaultRenderer() &&
+ RendererTypeForUrl(url) == RENDERER_TYPE_CHROME_DEFAULT_RENDERER) {
+ // Replace the user-agent header with Chrome's.
+ updated_headers = ReplaceOrAddUserAgent(*additional_headers,
+ http_utils::GetChromeUserAgent());
+ } else {
+ updated_headers = AppendCFUserAgentString(headers, *additional_headers);
+ }
*additional_headers = reinterpret_cast<wchar_t*>(::CoTaskMemRealloc(
- *additional_headers, (updated.length() + 1) * sizeof(wchar_t)));
- lstrcpyW(*additional_headers, ASCIIToWide(updated).c_str());
+ *additional_headers,
+ (updated_headers.length() + 1) * sizeof(wchar_t)));
+ lstrcpyW(*additional_headers, ASCIIToWide(updated_headers).c_str());
}
return S_OK;
}