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

Unified Diff: chrome/browser/first_run_win.cc

Issue 3012021: CommandLine: add a CopySwitchesFrom() for copying from another CommandLine (Closed)
Patch Set: minor cleanups Created 10 years, 5 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 | « chrome/browser/extensions/extension_uitest.cc ('k') | chrome/browser/gpu_process_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/first_run_win.cc
diff --git a/chrome/browser/first_run_win.cc b/chrome/browser/first_run_win.cc
index 32866ff0874b17ed77a660eae62c006e057ea2ae..38b5b660644a6795d8f54a3934356eaaf0d38339 100644
--- a/chrome/browser/first_run_win.cc
+++ b/chrome/browser/first_run_win.cc
@@ -682,12 +682,13 @@ bool FirstRun::ImportSettings(Profile* profile, int browser_type,
HWND parent_window) {
const CommandLine& cmdline = *CommandLine::ForCurrentProcess();
CommandLine import_cmd(cmdline.GetProgram());
- // Propagate user data directory switch.
- if (cmdline.HasSwitch(switches::kUserDataDir)) {
- import_cmd.AppendSwitchWithValue(
- switches::kUserDataDir,
- cmdline.GetSwitchValueASCII(switches::kUserDataDir));
- }
+
+ const char* kSwitchNames[] = {
+ switches::kUserDataDir,
+ switches::kChromeFrame,
+ switches::kCountry,
+ };
+ import_cmd.CopySwitchesFrom(cmdline, kSwitchNames, arraysize(kSwitchNames));
// Since ImportSettings is called before the local state is stored on disk
// we pass the language as an argument. GetApplicationLocale checks the
@@ -706,15 +707,6 @@ bool FirstRun::ImportSettings(Profile* profile, int browser_type,
switches::kImportFromFile, import_bookmarks_path.c_str());
}
- if (cmdline.HasSwitch(switches::kChromeFrame)) {
- import_cmd.AppendSwitch(switches::kChromeFrame);
- }
-
- if (cmdline.HasSwitch(switches::kCountry)) {
- import_cmd.AppendSwitchWithValue(switches::kCountry,
- cmdline.GetSwitchValueASCII(switches::kCountry));
- }
-
// Time to launch the process that is going to do the import.
base::ProcessHandle import_process;
if (!base::LaunchApp(import_cmd, false, false, &import_process))
« no previous file with comments | « chrome/browser/extensions/extension_uitest.cc ('k') | chrome/browser/gpu_process_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698