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

Side by Side Diff: android_webview/browser/net/aw_http_user_agent_settings.cc

Issue 1172093002: Implement HttpUserAgentSettings delegate for Android WebView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "android_webview/browser/net/aw_http_user_agent_settings.h"
6
7 #include "android_webview/browser/aw_content_browser_client.h"
8 #include "android_webview/common/aw_content_client.h"
9 #include "content/public/browser/browser_thread.h"
10 #include "net/http/http_util.h"
11
12 namespace android_webview {
13
14 AwHttpUserAgentSettings::AwHttpUserAgentSettings() {
15 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
16 }
17
18 AwHttpUserAgentSettings::~AwHttpUserAgentSettings() {
19 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
20 }
21
22 std::string AwHttpUserAgentSettings::GetAcceptLanguage() const {
23 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
24 std::string new_aw_accept_language =
25 AwContentBrowserClient::GetAcceptLangsImpl();
26 if (new_aw_accept_language != last_aw_accept_language_) {
27 last_http_accept_language_ =
28 net::HttpUtil::GenerateAcceptLanguageHeader(new_aw_accept_language);
29 last_aw_accept_language_ = new_aw_accept_language;
30 }
31 return last_http_accept_language_;
32 }
33
34 std::string AwHttpUserAgentSettings::GetUserAgent() const {
35 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
36 return android_webview::GetUserAgent();
37 }
38
39 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/browser/net/aw_http_user_agent_settings.h ('k') | android_webview/browser/net/aw_url_request_context_getter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698