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

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

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 #ifndef ANDROID_WEBVIEW_BROWSER_NET_AW_HTTP_USER_AGENT_SETTINGS_H_
6 #define ANDROID_WEBVIEW_BROWSER_NET_AW_HTTP_USER_AGENT_SETTINGS_H_
7
8 #include <string>
9
10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h"
12 #include "net/url_request/http_user_agent_settings.h"
13
14 namespace android_webview {
15
16 // An implementation of |HttpUserAgentSettings| that provides HTTP header
17 // Accept-Language value that tracks aw accept language.
18 class AwHttpUserAgentSettings : public net::HttpUserAgentSettings {
19 public:
20 // Must be called on the UI thread.
21 AwHttpUserAgentSettings();
22 // Must be called on the IO thread.
23 ~AwHttpUserAgentSettings() override;
24
25 // net::HttpUserAgentSettings implementation
26 std::string GetAcceptLanguage() const override;
27 std::string GetUserAgent() const override;
28
29 private:
30 // Avoid re-processing by caching the last value from the locale and the
31 // last result of processing via net::HttpUtil::GenerateAccept*Header().
32 mutable std::string last_aw_accept_language_;
33 mutable std::string last_http_accept_language_;
34
35 DISALLOW_COPY_AND_ASSIGN(AwHttpUserAgentSettings);
36 };
37
38 } // namespace android_webview
39
40 #endif // ANDROID_WEBVIEW_BROWSER_NET_AW_HTTP_USER_AGENT_SETTINGS_H_
41
OLDNEW
« no previous file with comments | « android_webview/browser/jni_dependency_factory.h ('k') | android_webview/browser/net/aw_http_user_agent_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698