Index: chrome/common/chrome_content_client.cc |
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc |
index 760a266d034ee21be0dd9f70d50d19427472245e..856dc777577c14b9f4034db26c1eb7ceb2e1c70d 100644 |
--- a/chrome/common/chrome_content_client.cc |
+++ b/chrome/common/chrome_content_client.cc |
@@ -300,12 +300,18 @@ bool ChromeContentClient::CanHandleWhileSwappedOut( |
return false; |
} |
-std::string ChromeContentClient::GetUserAgent(bool mimic_windows) const { |
- chrome::VersionInfo version_info; |
- std::string product("Chrome/"); |
- product += version_info.is_valid() ? version_info.Version() : "0.0.0.0"; |
- |
- return webkit_glue::BuildUserAgentHelper(mimic_windows, product); |
+std::string ChromeContentClient::GetUserAgent(bool *overriding) const { |
Evan Martin
2011/09/21 20:27:24
star on the left
|
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserAgent)) { |
Dirk Pranke
2011/09/21 20:02:48
I'm not sure if we can be sure that CommandLine::F
Evan Martin
2011/09/21 20:27:24
I think we don't have any real contract for it, so
Dirk Pranke
2011/09/21 21:02:35
ok.
|
+ *overriding = true; |
+ return CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
+ switches::kUserAgent); |
+ } else { |
+ *overriding = false; |
+ chrome::VersionInfo version_info; |
+ std::string product("Chrome/"); |
+ product += version_info.is_valid() ? version_info.Version() : "0.0.0.0"; |
+ return webkit_glue::BuildUserAgentHelper(product); |
+ } |
} |
string16 ChromeContentClient::GetLocalizedString(int message_id) const { |