Commit f6e6d2e3 authored by atwilson@chromium.org's avatar atwilson@chromium.org

Remove --no-startup-window flag when restarting chrome.

This fixes the problem where if chrome launches in background mode at login,
the next time we restart chrome we relaunch it in background mode again.

BUG=92391
TEST=Install background app, restart computer so chrome is launched on startup, go to about:flags and change a flag and choose 'Restart' - chrome should reopen any open windows on restart.


Review URL: http://codereview.chromium.org/8413023

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107763 0039d316-1c4b-4281-b951-d872f2087c98
parent 0b004b20
...@@ -1121,7 +1121,7 @@ const char* const kSwitchesToAddOnAutorestart[] = { ...@@ -1121,7 +1121,7 @@ const char* const kSwitchesToAddOnAutorestart[] = {
switches::kNoStartupWindow switches::kNoStartupWindow
}; };
void BrowserProcessImpl::RestartPersistentInstance() { void BrowserProcessImpl::RestartBackgroundInstance() {
CommandLine* old_cl = CommandLine::ForCurrentProcess(); CommandLine* old_cl = CommandLine::ForCurrentProcess();
scoped_ptr<CommandLine> new_cl(new CommandLine(old_cl->GetProgram())); scoped_ptr<CommandLine> new_cl(new CommandLine(old_cl->GetProgram()));
...@@ -1158,7 +1158,7 @@ void BrowserProcessImpl::RestartPersistentInstance() { ...@@ -1158,7 +1158,7 @@ void BrowserProcessImpl::RestartPersistentInstance() {
void BrowserProcessImpl::OnAutoupdateTimer() { void BrowserProcessImpl::OnAutoupdateTimer() {
if (CanAutorestartForUpdate()) { if (CanAutorestartForUpdate()) {
DLOG(WARNING) << "Detected update. Restarting browser."; DLOG(WARNING) << "Detected update. Restarting browser.";
RestartPersistentInstance(); RestartBackgroundInstance();
} }
} }
......
...@@ -304,7 +304,7 @@ class BrowserProcessImpl : public BrowserProcess, ...@@ -304,7 +304,7 @@ class BrowserProcessImpl : public BrowserProcess,
// restarted, and if that's the case, restarts the browser. // restarted, and if that's the case, restarts the browser.
void OnAutoupdateTimer(); void OnAutoupdateTimer();
bool CanAutorestartForUpdate() const; bool CanAutorestartForUpdate() const;
void RestartPersistentInstance(); void RestartBackgroundInstance();
#endif // defined(OS_WIN) || defined(OS_LINUX) #endif // defined(OS_WIN) || defined(OS_LINUX)
#if defined(OS_CHROMEOS) #if defined(OS_CHROMEOS)
......
...@@ -19,7 +19,9 @@ const char* const kSwitchesToRemoveOnAutorestart[] = { ...@@ -19,7 +19,9 @@ const char* const kSwitchesToRemoveOnAutorestart[] = {
switches::kFirstRun, switches::kFirstRun,
switches::kImport, switches::kImport,
switches::kImportFromFile, switches::kImportFromFile,
switches::kMakeDefaultBrowser switches::kMakeDefaultBrowser,
switches::kNoStartupWindow,
switches::kRestoreLastSession
}; };
void RemoveSwitchesForAutostart( void RemoveSwitchesForAutostart(
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment