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

Unified Diff: chrome/browser/first_run.cc

Issue 18248: CommandLine API rework (Closed)
Patch Set: fixes Created 11 years, 11 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/first_run.h ('k') | chrome/browser/images_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/first_run.cc
diff --git a/chrome/browser/first_run.cc b/chrome/browser/first_run.cc
index c6f4f29fe0507259fbaf693cfe046f432788c84a..8522a8bab8e31c3436aeea12a8b8e904325d3fef 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.
« no previous file with comments | « chrome/browser/first_run.h ('k') | chrome/browser/images_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698