OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chromecast/shell/browser/cast_http_user_agent_settings.h" | 5 #include "chromecast/shell/browser/cast_http_user_agent_settings.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chromecast/shell/common/cast_content_client.h" | 8 #include "chromecast/shell/common/cast_content_client.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "grit/chromecast_settings.h" | |
10 #include "net/http/http_util.h" | 11 #include "net/http/http_util.h" |
12 #include "ui/base/l10n/l10n_util.h" | |
11 | 13 |
12 namespace chromecast { | 14 namespace chromecast { |
13 namespace shell { | 15 namespace shell { |
14 | 16 |
15 CastHttpUserAgentSettings::CastHttpUserAgentSettings() { | 17 CastHttpUserAgentSettings::CastHttpUserAgentSettings() { |
16 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 18 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
17 } | 19 } |
18 | 20 |
19 CastHttpUserAgentSettings::~CastHttpUserAgentSettings() { | 21 CastHttpUserAgentSettings::~CastHttpUserAgentSettings() { |
20 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); | 22 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
21 } | 23 } |
22 | 24 |
23 std::string CastHttpUserAgentSettings::GetAcceptLanguage() const { | 25 std::string CastHttpUserAgentSettings::GetAcceptLanguage() const { |
24 accept_language_ = net::HttpUtil::GenerateAcceptLanguageHeader("en-US"); | 26 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
27 accept_language_ = net::HttpUtil::GenerateAcceptLanguageHeader( | |
byungchul
2014/08/14 20:34:11
why do you save the result while you don't use it?
gunsch
2014/08/15 00:04:27
Done.
| |
28 l10n_util::GetStringUTF8(IDS_CHROMECAST_SETTINGS_ACCEPT_LANGUAGES)); | |
25 return accept_language_; | 29 return accept_language_; |
26 } | 30 } |
27 | 31 |
28 std::string CastHttpUserAgentSettings::GetUserAgent() const { | 32 std::string CastHttpUserAgentSettings::GetUserAgent() const { |
29 return chromecast::shell::GetUserAgent(); | 33 return chromecast::shell::GetUserAgent(); |
30 } | 34 } |
31 | 35 |
32 } // namespace shell | 36 } // namespace shell |
33 } // namespace chromecast | 37 } // namespace chromecast |
OLD | NEW |