From 21a99ca2af8e66e3d8f8f93788aab966515bf62d Mon Sep 17 00:00:00 2001 From: "pam@chromium.org" Date: Fri, 12 Feb 2010 20:44:46 +0000 Subject: Add command line to about:version. BUG=18577 TEST=open about:version, see full command line (executable and switches) Review URL: http://codereview.chromium.org/603017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38935 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/app/generated_resources.grd | 6 ++++++ chrome/browser/browser_about_handler.cc | 16 ++++++++++++++++ chrome/browser/resources/about_version.html | 6 +++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 8ab5e78..7f28c30 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -3137,6 +3137,12 @@ Keep your key file in a safe place. You will need it to create new versions of y Developer Build + + User Agent + + + Command Line + diff --git a/chrome/browser/browser_about_handler.cc b/chrome/browser/browser_about_handler.cc index 9b1e706..e00a5774 100644 --- a/chrome/browser/browser_about_handler.cc +++ b/chrome/browser/browser_about_handler.cc @@ -527,7 +527,23 @@ std::string AboutVersion(DictionaryValue* localized_strings) { localized_strings->SetString(L"official", l10n_util::GetString(IDS_ABOUT_VERSION_UNOFFICIAL)); } + localized_strings->SetString(L"user_agent_name", + l10n_util::GetString(IDS_ABOUT_VERSION_USER_AGENT)); localized_strings->SetString(L"useragent", webkit_glue::GetUserAgent(GURL())); + localized_strings->SetString(L"command_line_name", + l10n_util::GetString(IDS_ABOUT_VERSION_COMMAND_LINE)); + +#if defined(OS_WIN) + localized_strings->SetString(L"command_line", + CommandLine::ForCurrentProcess()->command_line_string()); +#elif defined(OS_POSIX) + std::string command_line = ""; + typedef std::vector ArgvList; + const ArgvList& argv = CommandLine::ForCurrentProcess()->argv(); + for (ArgvList::const_iterator iter = argv.begin(); iter != argv.end(); iter++) + command_line += " " + *iter; + localized_strings->SetString(L"command_line", command_line); +#endif static const std::string version_html( ResourceBundle::GetSharedInstance().GetDataResource( diff --git a/chrome/browser/resources/about_version.html b/chrome/browser/resources/about_version.html index af3b8ad..29dc838 100644 --- a/chrome/browser/resources/about_version.html +++ b/chrome/browser/resources/about_version.html @@ -58,6 +58,7 @@ about:version template page .version { font-family: monospace; padding-left: 5px; + max-width: 430px; } @@ -82,9 +83,12 @@ about:version template page - User Agent + + + + -- cgit v1.1