Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1833)

Unified Diff: chrome/browser/net/chrome_url_request_context.cc

Issue 19025: Add support for UA spoofing, and spoof Safari's UA string when loading URLs... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/net/chrome_url_request_context.cc
===================================================================
--- chrome/browser/net/chrome_url_request_context.cc (revision 8714)
+++ chrome/browser/net/chrome_url_request_context.cc (working copy)
@@ -94,8 +94,6 @@
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 @@
}
}
-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);

Powered by Google App Engine
This is Rietveld 408576698