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

Unified Diff: chrome/app/chrome_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
« no previous file with comments | « no previous file | chrome/common/chrome_content_client.h » ('j') | chrome/test/base/chrome_test_suite.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/chrome_main_delegate.cc
diff --git a/chrome/app/chrome_main_delegate.cc b/chrome/app/chrome_main_delegate.cc
index 5a492d93cb23180bfb64663816e3f8c4aa030800..01f44fc5fb1d06513bbb34dadcd6d6bec9c53452 100644
--- a/chrome/app/chrome_main_delegate.cc
+++ b/chrome/app/chrome_main_delegate.cc
@@ -36,6 +36,7 @@
#include "content/public/common/content_switches.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/ui_base_switches.h"
+#include "webkit/glue/user_agent.h"
#if defined(OS_WIN)
#include <algorithm>
@@ -544,8 +545,14 @@ void ChromeMainDelegate::PreSandboxStartup() {
std::string process_type =
command_line.GetSwitchValueASCII(switches::kProcessType);
+ // Construct our user agent string.
+ chrome::VersionInfo version_info;
+ std::string product("Chrome/");
+ product += version_info.is_valid() ? version_info.Version() : "0.0.0.0";
+ std::string user_agent = webkit_glue::BuildUserAgentFromProduct(product);
scherkus (not reviewing) 2012/04/05 23:20:45 FYI this code was moved here instead of chrome_con
+
// Initialize the content client which that code uses to talk to Chrome.
- content::SetContentClient(&chrome_content_client_);
+ content::Initialize(&chrome_content_client_, user_agent);
InitializeChromeContentClient(process_type);
Dirk Pranke 2012/04/05 23:35:54 Nit: does it make sense to change this to somethin
scherkus (not reviewing) 2012/04/05 23:58:33 Agreed but will wait to hear back on jam on which
// Initialize the Chrome path provider.
« no previous file with comments | « no previous file | chrome/common/chrome_content_client.h » ('j') | chrome/test/base/chrome_test_suite.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698