summaryrefslogtreecommitdiffstats
path: root/chrome/browser/net/chrome_url_request_context.cc
diff options
context:
space:
mode:
authordarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-27 22:28:54 +0000
committerdarin@chromium.org <darin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-01-27 22:28:54 +0000
commit6f681a41c70030593dc14640920d8447ef9389f2 (patch)
treeda9b0bb6552dc93ba1c1ab59a47588e5bb9196e9 /chrome/browser/net/chrome_url_request_context.cc
parentb06878082f5dd7a9e289c0363e2aa9331a154fdb (diff)
downloadchromium_src-6f681a41c70030593dc14640920d8447ef9389f2.zip
chromium_src-6f681a41c70030593dc14640920d8447ef9389f2.tar.gz
chromium_src-6f681a41c70030593dc14640920d8447ef9389f2.tar.bz2
Add support for UA spoofing, and spoof Safari's UA string when loading URLs
from *.mail.live.com (to fix hotmail). BUG=4111 R=wtc Review URL: http://codereview.chromium.org/19025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8764 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/net/chrome_url_request_context.cc')
-rw-r--r--chrome/browser/net/chrome_url_request_context.cc13
1 files changed, 9 insertions, 4 deletions
diff --git a/chrome/browser/net/chrome_url_request_context.cc b/chrome/browser/net/chrome_url_request_context.cc
index f11b710..5cd4688 100644
--- a/chrome/browser/net/chrome_url_request_context.cc
+++ b/chrome/browser/net/chrome_url_request_context.cc
@@ -94,8 +94,6 @@ ChromeURLRequestContext* ChromeURLRequestContext::CreateOffTheRecord(
ChromeURLRequestContext::ChromeURLRequestContext(Profile* profile)
: prefs_(profile->GetPrefs()),
is_off_the_record_(profile->IsOffTheRecord()) {
- user_agent_ = webkit_glue::GetUserAgent();
-
// Set up Accept-Language and Accept-Charset header values
accept_language_ = net::HttpUtil::GenerateAcceptLanguageHeader(
WideToASCII(prefs_->GetString(prefs::kAcceptLanguages)));
@@ -183,14 +181,21 @@ FilePath ChromeURLRequestContext::GetPathForExtension(const std::string& id) {
}
}
-void ChromeURLRequestContext::OnAcceptLanguageChange(std::string accept_language) {
+const std::string& ChromeURLRequestContext::GetUserAgent(
+ const GURL& url) const {
+ return webkit_glue::GetUserAgent(url);
+}
+
+void ChromeURLRequestContext::OnAcceptLanguageChange(
+ std::string accept_language) {
DCHECK(MessageLoop::current() ==
ChromeThread::GetMessageLoop(ChromeThread::IO));
accept_language_ =
net::HttpUtil::GenerateAcceptLanguageHeader(accept_language);
}
-void ChromeURLRequestContext::OnCookiePolicyChange(net::CookiePolicy::Type type) {
+void ChromeURLRequestContext::OnCookiePolicyChange(
+ net::CookiePolicy::Type type) {
DCHECK(MessageLoop::current() ==
ChromeThread::GetMessageLoop(ChromeThread::IO));
cookie_policy_.SetType(type);