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

Unified Diff: chrome/common/chrome_content_client.cc

Issue 7922023: Remove webkit_glue::BuildUserAgent(), remove windows spoofing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge to r102225 Created 9 years, 3 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
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..42054fbe1133f22258369174f62ce6d781047f88 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 {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserAgent)) {
+ *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::BuildUserAgentFromProduct(product);
+ }
}
string16 ChromeContentClient::GetLocalizedString(int message_id) const {

Powered by Google App Engine
This is Rietveld 408576698