Index: content/common/content_client.cc |
diff --git a/content/common/content_client.cc b/content/common/content_client.cc |
index cc2bad4677f6416418ddd65467ac01a78300d783..1805529571271242cc71279524cc02a8aa4e92cc 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): It's ugly to call webkit_glue::SetUserAgent here, but |
jam
2011/09/21 21:27:36
nit: reading this, it's not clear why is it ugly?
|
+ // 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 replace SetContentClient() with a content::Initialize() |
+ // (so that it was clear we were doing more than setting a global). |
+ // Maybe we can merge this into ContentMain() somehow? |
+ if (client) { |
+ bool custom = false; |
+ std::string ua; |
+ ua = client->GetUserAgent(&custom); |
Evan Martin
2011/09/21 20:27:24
can merge this with the above line, if you want
Dirk Pranke
2011/09/21 21:02:35
Will do.
|
+ webkit_glue::SetUserAgent(ua, custom); |
+ } |
} |
ContentClient* GetContentClient() { |