diff options
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser_about_handler.cc | 2 | ||||
-rw-r--r-- | chrome/browser/net/chrome_url_request_context.cc | 13 | ||||
-rw-r--r-- | chrome/browser/net/chrome_url_request_context.h | 2 |
3 files changed, 12 insertions, 5 deletions
diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index 0445fc4..8c01f75 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -274,7 +274,7 @@ std::string BrowserAboutHandler::AboutVersion() { l10n_util::GetString(IDS_ABOUT_VERSION_UNOFFICIAL)); } localized_strings.SetString(L"useragent", - UTF8ToWide(webkit_glue::GetUserAgent())); + UTF8ToWide(webkit_glue::GetUserAgent(GURL()))); static const StringPiece version_html( ResourceBundle::GetSharedInstance().GetRawDataResource( 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); diff --git a/chrome/browser/net/chrome_url_request_context.h b/chrome/browser/net/chrome_url_request_context.h index 9ddbd47..915322e 100644 --- a/chrome/browser/net/chrome_url_request_context.h +++ b/chrome/browser/net/chrome_url_request_context.h @@ -44,6 +44,8 @@ class ChromeURLRequestContext : public URLRequestContext, return user_script_dir_path_; } + virtual const std::string& GetUserAgent(const GURL& url) const; + private: // Private constructor, use the static factory methods instead. This is // expected to be called on the UI thread. |