diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-21 01:00:22 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-21 01:00:22 +0000 |
commit | bb97536b768ac68fcbc4605c35461a798ef6e5ff (patch) | |
tree | 479bde96cd05a9e1f9d2746dd82313e2eb715e8e /chrome/browser/first_run.cc | |
parent | 8731a63268015f4e5d684833c11a1b44bd9ae468 (diff) | |
download | chromium_src-bb97536b768ac68fcbc4605c35461a798ef6e5ff.zip chromium_src-bb97536b768ac68fcbc4605c35461a798ef6e5ff.tar.gz chromium_src-bb97536b768ac68fcbc4605c35461a798ef6e5ff.tar.bz2 |
Make CommandLine into a normal object, with some statics for getting at the current process's command line.
One explicit goal of this change is to *not* deal with the string/wstring issues at the API on POSIX; the functions are the same as before, which means they remain as broken as before. (I did try to fix the internals, though, so migrating the callers is now possible by adding platform-appropriate hooks.)
Review URL: http://codereview.chromium.org/18248
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8347 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/first_run.cc')
-rwxr-xr-x | chrome/browser/first_run.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/chrome/browser/first_run.cc b/chrome/browser/first_run.cc index c6f4f29..8522a8b 100755 --- a/chrome/browser/first_run.cc +++ b/chrome/browser/first_run.cc @@ -450,8 +450,8 @@ bool DecodeImportParams(const std::wstring& encoded, bool FirstRun::ImportSettings(Profile* profile, int browser, int items_to_import, HWND parent_window) { - CommandLine cmdline; - std::wstring import_cmd(cmdline.program()); + const CommandLine& cmdline = *CommandLine::ForCurrentProcess(); + CommandLine import_cmd(cmdline.program()); // Propagate the following switches to the importer command line. static const wchar_t* const switch_names[] = { switches::kUserDataDir, @@ -459,12 +459,12 @@ bool FirstRun::ImportSettings(Profile* profile, int browser, }; for (int i = 0; i < arraysize(switch_names); ++i) { if (cmdline.HasSwitch(switch_names[i])) { - CommandLine::AppendSwitchWithValue( - &import_cmd, switch_names[i], + import_cmd.AppendSwitchWithValue( + switch_names[i], cmdline.GetSwitchValue(switch_names[i])); } } - CommandLine::AppendSwitchWithValue(&import_cmd, switches::kImport, + import_cmd.CommandLine::AppendSwitchWithValue(switches::kImport, EncodeImportParams(browser, items_to_import, parent_window)); // Time to launch the process that is going to do the import. |