diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 09:37:21 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 09:37:21 +0000 |
commit | 5c08f22715e7a86971a9878175d897554a0515f7 (patch) | |
tree | ba06ee8246d4ba966d4c4a4ed69a273bc186941d /chrome/browser/browser_process_impl.cc | |
parent | 1b3e5390c3b3ad2e4ddc3dd6b3412e89332d07cd (diff) | |
download | chromium_src-5c08f22715e7a86971a9878175d897554a0515f7.zip chromium_src-5c08f22715e7a86971a9878175d897554a0515f7.tar.gz chromium_src-5c08f22715e7a86971a9878175d897554a0515f7.tar.bz2 |
Remove one-time flags when restarting after update.
BUG=53407
TEST=SwitchUtilsTest.AddRemoveSwitches
Review URL: http://codereview.chromium.org/3307024
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60161 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 21 |
1 files changed, 4 insertions, 17 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 6ed0109..e9f2b83 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -56,6 +56,7 @@ #include "chrome/common/notification_service.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" +#include "chrome/common/switch_utils.h" #include "chrome/installer/util/google_update_constants.h" #include "ipc/ipc_logging.h" #include "webkit/database/database_tracker.h" @@ -755,18 +756,7 @@ bool BrowserProcessImpl::CanAutorestartForUpdate() const { Upgrade::IsUpdatePendingRestart(); } -// Switches enumerated here will be removed when a background instance of -// Chrome restarts itself. If your key is designed to only be used once, -// or if it does not make sense when restarting a background instance to -// pick up an automatic update, be sure to add it to this list. -const char* const kSwitchesToRemoveOnAutorestart[] = { - switches::kApp, - switches::kFirstRun, - switches::kImport, - switches::kImportFromFile, - switches::kMakeDefaultBrowser -}; - +// Switches to add when auto-restarting Chrome. const char* const kSwitchesToAddOnAutorestart[] = { switches::kNoStartupWindow }; @@ -778,10 +768,7 @@ void BrowserProcessImpl::RestartPersistentInstance() { std::map<std::string, CommandLine::StringType> switches = old_cl->GetSwitches(); - // Remove the keys that we shouldn't pass through during restart. - for (size_t i = 0; i < arraysize(kSwitchesToRemoveOnAutorestart); i++) { - switches.erase(kSwitchesToRemoveOnAutorestart[i]); - } + switches::RemoveSwitchesForAutostart(&switches); // Append the rest of the switches (along with their values, if any) // to the new command line @@ -796,7 +783,7 @@ void BrowserProcessImpl::RestartPersistentInstance() { } // Ensure that our desired switches are set on the new process. - for (size_t i = 0; i < arraysize(kSwitchesToAddOnAutorestart); i++) { + for (size_t i = 0; i < arraysize(kSwitchesToAddOnAutorestart); ++i) { if (!new_cl->HasSwitch(kSwitchesToAddOnAutorestart[i])) new_cl->AppendSwitch(kSwitchesToAddOnAutorestart[i]); } |