Chromium Code Reviews| 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..0b4008be15059ba10a3e4b4a5db4164d615d9c57 100644 |
| --- a/chrome/common/chrome_content_client.cc |
| +++ b/chrome/common/chrome_content_client.cc |
| @@ -430,16 +430,23 @@ bool ChromeContentClient::CanHandleWhileSwappedOut( |
| return false; |
| } |
| -std::string ChromeContentClient::GetUserAgent() const { |
| +std::string ChromeContentClient::GetProduct(bool mobile_device) const { |
|
tony
2012/08/24 19:46:17
I like the rename to GetProduct, but do we need to
gone
2012/08/24 20:35:11
Did it thinking that we might want to be able to c
|
| chrome::VersionInfo version_info; |
| std::string product("Chrome/"); |
| product += version_info.is_valid() ? version_info.Version() : "0.0.0.0"; |
| -#if defined(OS_ANDROID) |
| - CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| - if (command_line->HasSwitch(switches::kUseMobileUserAgent)) { |
| + if (mobile_device) { |
| product += " Mobile"; |
| } |
| + return product; |
| +} |
| + |
| +std::string ChromeContentClient::GetUserAgent() const { |
| + bool mobile_device = false; |
| +#if defined(OS_ANDROID) |
| + CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| + mobile_device = command_line->HasSwitch(switches::kUseMobileUserAgent); |
| #endif |
| + std::string product = GetProduct(mobile_device); |
| return webkit_glue::BuildUserAgentFromProduct(product); |
| } |