diff options
author | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-28 08:45:14 +0000 |
---|---|---|
committer | joth@chromium.org <joth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-07-28 08:45:14 +0000 |
commit | 97e8f05433b09ffe49cb5b62cfc3b75ac1e95936 (patch) | |
tree | 7f07ffb90f59338b3f72d76e98b53641ce19eba4 /android_webview/common | |
parent | 8d3eb6efe03fe41d185272d205f6c567a0773ee6 (diff) | |
download | chromium_src-97e8f05433b09ffe49cb5b62cfc3b75ac1e95936.zip chromium_src-97e8f05433b09ffe49cb5b62cfc3b75ac1e95936.tar.gz chromium_src-97e8f05433b09ffe49cb5b62cfc3b75ac1e95936.tar.bz2 |
[Android WebView] Include Mobile in the user agent
Mirror chrome UA logic, and include 'Mobile' in the product unless it's
a tablet.
NOTRY=true
BUG=internal b/10041691
Review URL: https://chromiumcodereview.appspot.com/20617003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@214107 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'android_webview/common')
-rw-r--r-- | android_webview/common/aw_content_client.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/android_webview/common/aw_content_client.cc b/android_webview/common/aw_content_client.cc index d6f31ef..fe4d8bb 100644 --- a/android_webview/common/aw_content_client.cc +++ b/android_webview/common/aw_content_client.cc @@ -5,6 +5,8 @@ #include "android_webview/common/aw_content_client.h" #include "base/basictypes.h" +#include "base/command_line.h" +#include "content/public/common/content_switches.h" #include "ipc/ipc_message.h" #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" @@ -18,7 +20,12 @@ std::string AwContentClient::GetProduct() const { } std::string AwContentClient::GetUserAgent() const { - return webkit_glue::BuildUserAgentFromProduct(GetProduct()); + std::string product = GetProduct(); + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kUseMobileUserAgent)) { + product += " Mobile"; + } + return webkit_glue::BuildUserAgentFromProduct(product); } string16 AwContentClient::GetLocalizedString(int message_id) const { |