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

Unified Diff: android_webview/common/aw_content_client.cc

Issue 191093002: Simplify the user agent code some more since after r255534 it's not affected by the site's URL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: patchset 15 which works Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/common/aw_content_client.h ('k') | android_webview/native/aw_settings.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/common/aw_content_client.cc
===================================================================
--- android_webview/common/aw_content_client.cc (revision 255867)
+++ android_webview/common/aw_content_client.cc (working copy)
@@ -12,16 +12,20 @@
#include "ui/base/resource/resource_bundle.h"
#include "webkit/common/user_agent/user_agent_util.h"
-namespace android_webview {
+namespace {
-std::string AwContentClient::GetProduct() const {
+std::string GetProduct() {
// "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 {
+}
+
+namespace android_webview {
+
+std::string GetUserAgent() {
// "Version/4.0" had been hardcoded in the legacy WebView.
std::string product = "Version/4.0 " + GetProduct();
if (CommandLine::ForCurrentProcess()->HasSwitch(
@@ -31,6 +35,14 @@
return webkit_glue::BuildUserAgentFromProduct(product);
}
+std::string AwContentClient::GetProduct() const {
+ return ::GetProduct();
+}
+
+std::string AwContentClient::GetUserAgent() const {
+ return android_webview::GetUserAgent();
+}
+
base::string16 AwContentClient::GetLocalizedString(int message_id) const {
// TODO(boliu): Used only by WebKit, so only bundle those resources for
// Android WebView.
« no previous file with comments | « android_webview/common/aw_content_client.h ('k') | android_webview/native/aw_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698