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

Unified Diff: webkit/glue/user_agent.cc

Issue 6581054: Drop "Windows;" from the UA string. This parallels https://bugs.webkit.org/s... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/user_agent.cc
===================================================================
--- webkit/glue/user_agent.cc (revision 75955)
+++ webkit/glue/user_agent.cc (working copy)
@@ -71,7 +71,7 @@
os_bugfix_version
#elif defined(OS_CHROMEOS)
"CrOS %s %d.%d.%d",
- cputype.c_str(), // e.g. i686
+ cputype.c_str(), // e.g. i686
os_major_version,
os_minor_version,
os_bugfix_version
@@ -88,13 +88,13 @@
void BuildUserAgent(bool mimic_windows, std::string* result) {
const char kUserAgentPlatform[] =
#if defined(OS_WIN)
- "Windows";
+ "";
#elif defined(OS_MACOSX)
- "Macintosh";
+ "Macintosh; ";
#elif defined(USE_X11)
- "X11"; // strange, but that's what Firefox uses
+ "X11; "; // strange, but that's what Firefox uses
#else
- "?";
+ "Unknown; ";
#endif
// Get the product name and version, and replace Safari's Version/X string
@@ -105,10 +105,10 @@
// Derived from Safari's UA string.
base::StringAppendF(
result,
- "Mozilla/5.0 (%s; %s) AppleWebKit/%d.%d"
+ "Mozilla/5.0 (%s%s) AppleWebKit/%d.%d"
" (KHTML, like Gecko) %s Safari/%d.%d",
- mimic_windows ? "Windows" : kUserAgentPlatform,
- ((mimic_windows ? "Windows " : "") + BuildOSCpuInfo()).c_str(),
+ mimic_windows ? "Windows " : kUserAgentPlatform,
darin (slow to review) 2011/02/25 09:44:08 is this doing the right thing when mimic_windows i
Peter Kasting 2011/02/25 17:37:32 It produces a string that transforms the new Windo
+ BuildOSCpuInfo().c_str(),
WEBKIT_VERSION_MAJOR,
WEBKIT_VERSION_MINOR,
product.c_str(),
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698