From d5f53a6a42306086eb6fe64e56456959f4931fd9 Mon Sep 17 00:00:00 2001 From: "estade@chromium.org" Date: Fri, 18 Dec 2009 02:40:24 +0000 Subject: Adds the cmdline "--new-window" that instructs the init sequence to open a new window instead of reusing the most recent tab for opening cmdline URLs. BUG=2843 TEST=Run with --new-window switch and confirm that a new window pops up patch by original review: Review URL: http://codereview.chromium.org/503023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34926 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/browser_init.cc | 3 ++- chrome/common/chrome_switches.cc | 3 +++ chrome/common/chrome_switches.h | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) (limited to 'chrome') diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index b42509d..3ccb82f 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -439,8 +439,9 @@ bool BrowserInit::LaunchWithProfile::Launch(Profile* profile, Browser* browser = NULL; if (urls_to_open.empty()) AddStartupURLs(&urls_to_open); - else + else if (!command_line_.HasSwitch(switches::kOpenInNewWindow)) browser = BrowserList::GetLastActive(); + OpenURLsInBrowser(browser, process_startup, urls_to_open); } if (process_startup) { diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index 9c6dcb8..f29433d 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -399,6 +399,9 @@ const char kNoSandbox[] = "no-sandbox"; // Number of entries to show in the omnibox popup. const char kOmniBoxPopupCount[] = "omnibox-popup-count"; +// Launch URL in new browser window. +const char kOpenInNewWindow[] = "new-window"; + // Package an extension to a .crx installable file from a given directory. const char kPackExtension[] = "pack-extension"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index fea4fdc..ca1144d 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -121,6 +121,7 @@ extern const char kNoJsRandomness[]; extern const char kNoProxyServer[]; extern const char kNoSandbox[]; extern const char kOmniBoxPopupCount[]; +extern const char kOpenInNewWindow[]; extern const char kPackExtension[]; extern const char kPackExtensionKey[]; extern const char kParentProfile[]; -- cgit v1.1