summaryrefslogtreecommitdiffstats
path: root/android_webview/common
diff options
context:
space:
mode:
authorjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-26 23:29:06 +0000
committerjoth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-26 23:29:06 +0000
commitf58731ed52d36df88ba4ab11fc2dc8457fcbc3e0 (patch)
tree06be43b89b263998dffde08f2a01696ec9d9df3b /android_webview/common
parentb4aef95883fec95e5c08d1e36d8c60af84bd86dc (diff)
downloadchromium_src-f58731ed52d36df88ba4ab11fc2dc8457fcbc3e0.zip
chromium_src-f58731ed52d36df88ba4ab11fc2dc8457fcbc3e0.tar.gz
chromium_src-f58731ed52d36df88ba4ab11fc2dc8457fcbc3e0.tar.bz2
Extend WebView useragent to mention Chrome version.
Add "Chrome/XX.0.0.0" to the WebView's useragent to hint to servers that the rendering engine is a modern Chromium and therefore it's okay to serve "good" content to it. We keep the existing "Version/4.0" token in case WebView-specific content is sniffing for it. The generic version 33.0.0.0 is used as the version of Chromium in the WebView does not correspond to any exact Chromium branch and trunk is currently designated as M33. Bug: 10659017 Change-Id: I5c80509955ffb491f07b48cc5a0b0023ceb368a3 BUG=297522 NOTRY=true Review URL: https://codereview.chromium.org/86843002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@237435 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/common')
-rw-r--r--android_webview/common/aw_content_client.cc9
1 files changed, 6 insertions, 3 deletions
diff --git a/android_webview/common/aw_content_client.cc b/android_webview/common/aw_content_client.cc
index fe4d8bb..30ef6c2 100644
--- a/android_webview/common/aw_content_client.cc
+++ b/android_webview/common/aw_content_client.cc
@@ -15,12 +15,15 @@
namespace android_webview {
std::string AwContentClient::GetProduct() const {
- // "Version/4.0" had been hardcoded in the legacy WebView.
- return std::string("Version/4.0");
+ // "Chrome/XX.0.0.0" identifies that this WebView is derived from the
+ // corresponding Chromium version XX.
+ // TODO(torne): Use chrome/VERSION file. See http://crbug.com/297522
+ return "Chrome/33.0.0.0";
}
std::string AwContentClient::GetUserAgent() const {
- std::string product = GetProduct();
+ // "Version/4.0" had been hardcoded in the legacy WebView.
+ std::string product = "Version/4.0 " + GetProduct();
if (CommandLine::ForCurrentProcess()->HasSwitch(
switches::kUseMobileUserAgent)) {
product += " Mobile";