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

Unified Diff: webkit/glue/user_agent.cc

Issue 8002003: Revert "Remove webkit_glue::BuildUserAgent(), change the contract in webkit_glue" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « webkit/glue/user_agent.h ('k') | webkit/glue/webkit_glue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/user_agent.cc
diff --git a/webkit/glue/user_agent.cc b/webkit/glue/user_agent.cc
index c9b3828429bfb4576ffc1a2a94ecaebbaf8b7a67..7f9b43882e9f64f54a90e5be21f3776d7a9f66d7 100644
--- a/webkit/glue/user_agent.cc
+++ b/webkit/glue/user_agent.cc
@@ -113,7 +113,8 @@ int GetWebKitMinorVersion() {
return WEBKIT_VERSION_MINOR;
}
-std::string BuildUserAgentFromProduct(const std::string& product) {
+std::string BuildUserAgentHelper(bool mimic_windows,
+ const std::string& product) {
const char kUserAgentPlatform[] =
#if defined(OS_WIN)
"";
@@ -127,6 +128,7 @@ std::string BuildUserAgentFromProduct(const std::string& product) {
std::string user_agent;
+ // Replace Safari's Version/X string with the product name/version passed in.
// This is done to expose our product name in a manner that is maximally
// compatible with Safari, we hope!!
@@ -135,7 +137,7 @@ std::string BuildUserAgentFromProduct(const std::string& product) {
&user_agent,
"Mozilla/5.0 (%s%s) AppleWebKit/%d.%d"
" (KHTML, like Gecko) %s Safari/%d.%d",
- kUserAgentPlatform,
+ mimic_windows ? "Windows " : kUserAgentPlatform,
webkit_glue::BuildOSCpuInfo().c_str(),
WEBKIT_VERSION_MAJOR,
WEBKIT_VERSION_MINOR,
« no previous file with comments | « webkit/glue/user_agent.h ('k') | webkit/glue/webkit_glue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698