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

Unified Diff: content/shell/shell_main_delegate.cc

Issue 9623027: Move --user-agent overriding logic from chrome into content. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src
Patch Set: replace SetContentClient() with Initialize() Created 8 years, 8 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/shell/shell_main_delegate.cc
diff --git a/content/shell/shell_main_delegate.cc b/content/shell/shell_main_delegate.cc
index 01157ab51d39b3eb26789da6e1b550a1ea41cc8e..32439fefc9c5429e6fc68eea6b449fc0fa7a9a31 100644
--- a/content/shell/shell_main_delegate.cc
+++ b/content/shell/shell_main_delegate.cc
@@ -15,6 +15,7 @@
#include "content/shell/shell_content_utility_client.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_paths.h"
+#include "webkit/glue/user_agent.h"
#if defined(OS_MACOSX)
#include "content/shell/paths_mac.h"
@@ -42,7 +43,13 @@ void ShellMainDelegate::PreSandboxStartup() {
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
- content::SetContentClient(&content_client_);
+ // The "19" is so that sites that sniff for version think that this is
+ // something reasonably current; the "77.34.5" is a hint that this isn't a
+ // standard Chrome.
+ std::string user_agent =
+ webkit_glue::BuildUserAgentFromProduct("Chrome/19.77.34.5");
+
+ content::Initialize(&content_client_, user_agent);
InitializeShellContentClient(process_type);
InitializeResourceBundle();

Powered by Google App Engine
This is Rietveld 408576698