summaryrefslogtreecommitdiffstats
path: root/webkit/glue/user_agent.cc
diff options
context:
space:
mode:
authordpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-22 19:44:41 +0000
committerdpranke@chromium.org <dpranke@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-22 19:44:41 +0000
commit6568e6bb74a14bb6be71c1963c223ebe51eb4b4d (patch)
tree3855fdcd8a01d31682d566a9317b95a67b4fee3a /webkit/glue/user_agent.cc
parent9d43e371e6c0b70b938575690f561f3742ad8397 (diff)
downloadchromium_src-6568e6bb74a14bb6be71c1963c223ebe51eb4b4d.zip
chromium_src-6568e6bb74a14bb6be71c1963c223ebe51eb4b4d.tar.gz
chromium_src-6568e6bb74a14bb6be71c1963c223ebe51eb4b4d.tar.bz2
Remove webkit_glue::BuildUserAgent(), change the contract in webkit_glue so that SetUserAgent() must be called before GetUserAgent().
This was causing a dependency inversion between webkit_support and its clients, and was needed for the content component build. For content users, calling SetContentClient() will automatically initialize the user agent (retrieved from client->GetUserAgent()). As a bonus, fixing this allowed me to re-test the "mimic_windows" code path and it looks like we no longer need it. R=jam@chromium.org,tony@chromium.org BUG=11136,90442 TEST=visit yahoo! mail using Chromium on Linux, ensure that we don't get an "unsupported browser" warning. Review URL: http://codereview.chromium.org/7922023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102336 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/user_agent.cc')
-rw-r--r--webkit/glue/user_agent.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/webkit/glue/user_agent.cc b/webkit/glue/user_agent.cc
index 7f9b438..c9b3828 100644
--- a/webkit/glue/user_agent.cc
+++ b/webkit/glue/user_agent.cc
@@ -113,8 +113,7 @@ int GetWebKitMinorVersion() {
return WEBKIT_VERSION_MINOR;
}
-std::string BuildUserAgentHelper(bool mimic_windows,
- const std::string& product) {
+std::string BuildUserAgentFromProduct(const std::string& product) {
const char kUserAgentPlatform[] =
#if defined(OS_WIN)
"";
@@ -128,7 +127,6 @@ std::string BuildUserAgentHelper(bool mimic_windows,
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!!
@@ -137,7 +135,7 @@ std::string BuildUserAgentHelper(bool mimic_windows,
&user_agent,
"Mozilla/5.0 (%s%s) AppleWebKit/%d.%d"
" (KHTML, like Gecko) %s Safari/%d.%d",
- mimic_windows ? "Windows " : kUserAgentPlatform,
+ kUserAgentPlatform,
webkit_glue::BuildOSCpuInfo().c_str(),
WEBKIT_VERSION_MAJOR,
WEBKIT_VERSION_MINOR,