diff options
author | pam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-12 20:44:46 +0000 |
---|---|---|
committer | pam@chromium.org <pam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-12 20:44:46 +0000 |
commit | 21a99ca2af8e66e3d8f8f93788aab966515bf62d (patch) | |
tree | 81ea86d08d7d01b7cca5933f380816124edb46b9 | |
parent | a67fa08ebbe6ccdcf58e654a1609c38fdae65e60 (diff) | |
download | chromium_src-21a99ca2af8e66e3d8f8f93788aab966515bf62d.zip chromium_src-21a99ca2af8e66e3d8f8f93788aab966515bf62d.tar.gz chromium_src-21a99ca2af8e66e3d8f8f93788aab966515bf62d.tar.bz2 |
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
-rw-r--r-- | chrome/app/generated_resources.grd | 6 | ||||
-rw-r--r-- | chrome/browser/browser_about_handler.cc | 16 | ||||
-rw-r--r-- | chrome/browser/resources/about_version.html | 6 |
3 files changed, 27 insertions, 1 deletions
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 <message name="IDS_ABOUT_VERSION_UNOFFICIAL" desc="unofficial build on the about:version page"> Developer Build </message> + <message name="IDS_ABOUT_VERSION_USER_AGENT" desc="label for the user agent on the about:version page"> + User Agent + </message> + <message name="IDS_ABOUT_VERSION_COMMAND_LINE" desc="label for the command line on the about:version page"> + Command Line + </message> <!-- Javascript Dialog Box strings --> <message name="IDS_JAVASCRIPT_ALERT_DEFAULT_TITLE" desc="Title for Javascript alert originating from a web page if there is no hostname to display"> 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<std::string> 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; } </style> </head> @@ -82,9 +83,12 @@ about:version template page <tr><td class="label" valign="top" i18n-content="js_engine"></td> <td class="version" id="js_version" i18n-content="js_version"></td> </tr> - <tr><td class="label" valign="top">User Agent</td> + <tr><td class="label" valign="top" i18n-content="user_agent_name"></td> <td class="version" id="useragent" i18n-content="useragent"></td> </tr> + <tr><td class="label" valign="top" i18n-content="command_line_name"></td> + <td class="version" id="Td1" i18n-content="command_line"></td> + </tr> </table> </div> </body> |