Index: content/common/content_client.cc |
diff --git a/content/common/content_client.cc b/content/common/content_client.cc |
index cc2bad4677f6416418ddd65467ac01a78300d783..4622ce45b9607f812869637e6dccaca96588b6ef 100644 |
--- a/content/common/content_client.cc |
+++ b/content/common/content_client.cc |
@@ -5,6 +5,7 @@ |
#include "content/common/content_client.h" |
#include "base/string_piece.h" |
+#include "webkit/glue/webkit_glue.h" |
namespace content { |
@@ -12,6 +13,19 @@ static ContentClient* g_client; |
void SetContentClient(ContentClient* client) { |
g_client = client; |
+ |
+ // TODO(dpranke): Doing real work (calling webkit_glue::SetUserAgent) |
+ // inside what looks like a function that initializes a global is a |
+ // bit odd, but we need to make sure this is done before |
+ // webkit_glue::GetUserAgent() is called (so that the UA doesn't change). |
+ // |
+ // It would be cleaner if we could rename this to something like a |
+ // content::Initialize(). Maybe we can merge this into ContentMain() somehow? |
+ if (client) { |
+ bool custom = false; |
+ std::string ua = client->GetUserAgent(&custom); |
+ webkit_glue::SetUserAgent(ua, custom); |
+ } |
} |
ContentClient* GetContentClient() { |