OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/net/ios_chrome_http_user_agent_settings.h" | 5 #include "ios/chrome/browser/net/ios_chrome_http_user_agent_settings.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "components/prefs/pref_service.h" |
8 #include "ios/chrome/browser/pref_names.h" | 8 #include "ios/chrome/browser/pref_names.h" |
9 #include "ios/web/public/web_client.h" | 9 #include "ios/web/public/web_client.h" |
10 #include "ios/web/public/web_thread.h" | 10 #include "ios/web/public/web_thread.h" |
11 #include "net/http/http_util.h" | 11 #include "net/http/http_util.h" |
12 | 12 |
13 IOSChromeHttpUserAgentSettings::IOSChromeHttpUserAgentSettings( | 13 IOSChromeHttpUserAgentSettings::IOSChromeHttpUserAgentSettings( |
14 PrefService* prefs) { | 14 PrefService* prefs) { |
15 DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); | 15 DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::UI); |
16 pref_accept_language_.Init(prefs::kAcceptLanguages, prefs); | 16 pref_accept_language_.Init(prefs::kAcceptLanguages, prefs); |
17 last_pref_accept_language_ = *pref_accept_language_; | 17 last_pref_accept_language_ = *pref_accept_language_; |
(...skipping 20 matching lines...) Expand all Loading... |
38 net::HttpUtil::GenerateAcceptLanguageHeader(new_pref_accept_language); | 38 net::HttpUtil::GenerateAcceptLanguageHeader(new_pref_accept_language); |
39 last_pref_accept_language_ = new_pref_accept_language; | 39 last_pref_accept_language_ = new_pref_accept_language; |
40 } | 40 } |
41 return last_http_accept_language_; | 41 return last_http_accept_language_; |
42 } | 42 } |
43 | 43 |
44 std::string IOSChromeHttpUserAgentSettings::GetUserAgent() const { | 44 std::string IOSChromeHttpUserAgentSettings::GetUserAgent() const { |
45 DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); | 45 DCHECK_CURRENTLY_ON_WEB_THREAD(web::WebThread::IO); |
46 return web::GetWebClient()->GetUserAgent(false); | 46 return web::GetWebClient()->GetUserAgent(false); |
47 } | 47 } |
OLD | NEW |