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

Unified Diff: content/common/content_client.cc

Issue 7922023: Remove webkit_glue::BuildUserAgent(), remove windows spoofing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix GetUserAgent() to return whether the user agent is overriding, clean up 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
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() {

Powered by Google App Engine
This is Rietveld 408576698