summaryrefslogtreecommitdiffstats
path: root/chrome_frame/urlmon_url_request.cc
diff options
context:
space:
mode:
authortommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 15:05:02 +0000
committertommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-31 15:05:02 +0000
commite67a73f47398a8d89a98abde04f3d4c7695a6d30 (patch)
treeae5652a01e709405ab8fc3c2887b0b96b38ca490 /chrome_frame/urlmon_url_request.cc
parent22e1168491f768ae6ff20ded07b3063ac5fe34db (diff)
downloadchromium_src-e67a73f47398a8d89a98abde04f3d4c7695a6d30.zip
chromium_src-e67a73f47398a8d89a98abde04f3d4c7695a6d30.tar.gz
chromium_src-e67a73f47398a8d89a98abde04f3d4c7695a6d30.tar.bz2
When GCF is the default renderer, use Chrome's User-agent header instead of IE's.
TEST=Set IsDefaultRenderer to 1 (REG_DWORD) under the ChromeFrame registry key. Check if the User agent header in requests is the Chrome user agent. Then set the value to 0 and make sure the regular user-agent header is there. BUG=50788 Review URL: http://codereview.chromium.org/3130016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@57991 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/urlmon_url_request.cc')
-rw-r--r--chrome_frame/urlmon_url_request.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc
index 26713a8..ea064e3 100644
--- a/chrome_frame/urlmon_url_request.cc
+++ b/chrome_frame/urlmon_url_request.cc
@@ -560,7 +560,12 @@ STDMETHODIMP UrlmonUrlRequest::BeginningTransaction(const wchar_t* url,
}
// In the rare case if "User-Agent" string is already in |current_headers|.
- new_headers += AppendCFUserAgentString(current_headers, NULL);
+ if (IsGcfDefaultRenderer()) {
+ new_headers += ReplaceOrAddUserAgent(current_headers,
+ http_utils::GetChromeUserAgent());
+ } else {
+ new_headers += AppendCFUserAgentString(current_headers, NULL);
+ }
if (!new_headers.empty()) {
*additional_headers = reinterpret_cast<wchar_t*>(