Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5014)

Unified Diff: chrome/browser/browser_process_impl.cc

Issue 3307024: Remove one-time flags when restarting after update.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/browser_shutdown.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser_process_impl.cc
===================================================================
--- chrome/browser/browser_process_impl.cc (revision 59914)
+++ chrome/browser/browser_process_impl.cc (working copy)
@@ -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"
@@ -754,18 +755,7 @@
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
};
@@ -777,10 +767,7 @@
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
@@ -795,7 +782,7 @@
}
// 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]);
}
« no previous file with comments | « no previous file | chrome/browser/browser_shutdown.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698