diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-18 03:25:32 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-18 03:25:32 +0000 |
commit | 4efe77c3fd39df0dc03b0d73ca0ba24c6e66ff28 (patch) | |
tree | 1643cc478cab057056cbd3ae038b88c3e7df92b4 | |
parent | f3e340dbd048915d2ba99268231e58cafa4b008a (diff) | |
download | chromium_src-4efe77c3fd39df0dc03b0d73ca0ba24c6e66ff28.zip chromium_src-4efe77c3fd39df0dc03b0d73ca0ba24c6e66ff28.tar.gz chromium_src-4efe77c3fd39df0dc03b0d73ca0ba24c6e66ff28.tar.bz2 |
linux: print something when reusing an existing process
Since it's common start Chrome from the command line, we should print
something to indicate that it's intentionally quitting immediately.
This is the source of a lot of bug reports.
BUG=12918
Review URL: http://codereview.chromium.org/155740
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21041 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/app/generated_resources.grd | 4 | ||||
-rw-r--r-- | chrome/browser/browser_main.cc | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 0f39ed2..fcae759 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -4068,6 +4068,10 @@ each locale. --> rgba($1, $2, $3, $4) </message> + <message name="IDS_USED_EXISTING_BROWSER" desc="Linux-specific message printed to console when the app is ran a second time, causing a new window to show rather than starting up a new browser."> + Created new window in existing browser session. + </message> + </messages> </release> </grit> diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 15906f9..4b938c6 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -18,6 +18,7 @@ #include "base/process_util.h" #include "base/string_piece.h" #include "base/string_util.h" +#include "base/sys_string_conversions.h" #include "base/system_monitor.h" #include "base/time.h" #include "base/tracked_objects.h" @@ -568,8 +569,13 @@ int BrowserMain(const MainFunctionParams& parameters) { return FirstRun::ImportNow(profile, parsed_command_line); // When another process is running, use it instead of starting us. - if (process_singleton.NotifyOtherProcess()) + if (process_singleton.NotifyOtherProcess()) { +#if defined(OS_LINUX) + printf("%s\n", base::SysWideToNativeMB( + l10n_util::GetString(IDS_USED_EXISTING_BROWSER)).c_str()); +#endif return ResultCodes::NORMAL_EXIT; + } // Do the tasks if chrome has been upgraded while it was last running. if (!already_running && DoUpgradeTasks(parsed_command_line)) { |