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

Unified Diff: chrome/common/chrome_content_client.cc

Issue 10854251: Allow the creation of partially spoofed user agents (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Moving namespaces Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/chrome_content_client.h ('k') | chrome/common/chrome_content_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_content_client.cc
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc
index 05ed4c5aa345ff1d2cfdac9e9d5ebb78b8c16c46..bee02ada84403b34142983764ef14ba2deb16840 100644
--- a/chrome/common/chrome_content_client.cc
+++ b/chrome/common/chrome_content_client.cc
@@ -430,15 +430,19 @@ bool ChromeContentClient::CanHandleWhileSwappedOut(
return false;
}
-std::string ChromeContentClient::GetUserAgent() const {
+std::string ChromeContentClient::GetProduct() const {
chrome::VersionInfo version_info;
std::string product("Chrome/");
product += version_info.is_valid() ? version_info.Version() : "0.0.0.0";
+ return product;
+}
+
+std::string ChromeContentClient::GetUserAgent() const {
+ std::string product = GetProduct();
#if defined(OS_ANDROID)
CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kUseMobileUserAgent)) {
+ if (command_line->HasSwitch(switches::kUseMobileUserAgent))
product += " Mobile";
- }
#endif
return webkit_glue::BuildUserAgentFromProduct(product);
}
« no previous file with comments | « chrome/common/chrome_content_client.h ('k') | chrome/common/chrome_content_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698