OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/net/chrome_http_user_agent_settings.h" | 5 #include "chrome/browser/net/chrome_http_user_agent_settings.h" |
6 | 6 |
7 #include "chrome/browser/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/common/pref_names.h" | 8 #include "chrome/common/pref_names.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "content/public/common/content_client.h" | 10 #include "content/public/common/content_client.h" |
11 #include "net/http/http_util.h" | 11 #include "net/http/http_util.h" |
12 | 12 |
13 ChromeHttpUserAgentSettings::ChromeHttpUserAgentSettings(PrefService* prefs) { | 13 ChromeHttpUserAgentSettings::ChromeHttpUserAgentSettings(PrefService* prefs) { |
14 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 14 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
15 pref_accept_language_.Init(prefs::kAcceptLanguages, prefs); | 15 pref_accept_language_.Init(prefs::kAcceptLanguages, prefs); |
16 pref_accept_charset_.Init(prefs::kDefaultCharset, prefs); | 16 pref_accept_charset_.Init(prefs::kDefaultCharset, prefs); |
17 last_pref_accept_language_ = *pref_accept_language_; | 17 last_pref_accept_language_ = *pref_accept_language_; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 last_pref_accept_charset_ = new_pref_accept_charset; | 58 last_pref_accept_charset_ = new_pref_accept_charset; |
59 } | 59 } |
60 return last_http_accept_charset_; | 60 return last_http_accept_charset_; |
61 } | 61 } |
62 | 62 |
63 std::string ChromeHttpUserAgentSettings::GetUserAgent(const GURL& url) const { | 63 std::string ChromeHttpUserAgentSettings::GetUserAgent(const GURL& url) const { |
64 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); | 64 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
65 return content::GetUserAgent(url); | 65 return content::GetUserAgent(url); |
66 } | 66 } |
67 | 67 |
OLD | NEW |