diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-11 22:43:58 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-11 22:43:58 +0000 |
commit | 6c550636c2b80fe4b69b3f5c948e7972fd0c94f4 (patch) | |
tree | 8f266b980e196c269d030838cb67cbe998e25324 /chrome | |
parent | b1080093bca40696fae18292fbd40129412cb381 (diff) | |
download | chromium_src-6c550636c2b80fe4b69b3f5c948e7972fd0c94f4.zip chromium_src-6c550636c2b80fe4b69b3f5c948e7972fd0c94f4.tar.gz chromium_src-6c550636c2b80fe4b69b3f5c948e7972fd0c94f4.tar.bz2 |
If the user runs chrome with a language on the command line on
first-run, make sure we pass that language to the importer process.
The code for this is basically a copy of what is in
chrome/browser/render_process_host.cc:291.
TEST=Run "chrome --lang=ko --first-run" and import settings during first
run. Make sure the importer dialog is in Korean.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@673 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/first_run.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/chrome/browser/first_run.cc b/chrome/browser/first_run.cc index 9824462..60e19bc 100644 --- a/chrome/browser/first_run.cc +++ b/chrome/browser/first_run.cc @@ -329,10 +329,17 @@ bool FirstRun::ImportSettings(Profile* profile, int browser, int items_to_import, HWND parent_window) { CommandLine cmdline; std::wstring import_cmd(cmdline.program()); - std::wstring data_dir(cmdline.GetSwitchValue(switches::kUserDataDir)); - if (!data_dir.empty()) { - CommandLine::AppendSwitchWithValue(&import_cmd, switches::kUserDataDir, - data_dir); + // Propagate the following switches to the importer command line. + static const wchar_t* const switch_names[] = { + switches::kUserDataDir, + switches::kLang, + }; + for (int i = 0; i < arraysize(switch_names); ++i) { + if (cmdline.HasSwitch(switch_names[i])) { + CommandLine::AppendSwitchWithValue( + &import_cmd, switch_names[i], + cmdline.GetSwitchValue(switch_names[i])); + } } CommandLine::AppendSwitchWithValue(&import_cmd, switches::kImport, EncodeImportParams(browser, items_to_import, parent_window)); |