OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/first_run.h" | 5 #include "chrome/browser/first_run.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 | 10 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 bool LaunchSetupWithParam(const std::string& param, const std::wstring& value, | 113 bool LaunchSetupWithParam(const std::string& param, const std::wstring& value, |
114 int* ret_code) { | 114 int* ret_code) { |
115 FilePath exe_path; | 115 FilePath exe_path; |
116 if (!PathService::Get(base::DIR_MODULE, &exe_path)) | 116 if (!PathService::Get(base::DIR_MODULE, &exe_path)) |
117 return false; | 117 return false; |
118 exe_path = exe_path.Append(installer_util::kInstallerDir); | 118 exe_path = exe_path.Append(installer_util::kInstallerDir); |
119 exe_path = exe_path.Append(installer_util::kSetupExe); | 119 exe_path = exe_path.Append(installer_util::kSetupExe); |
120 base::ProcessHandle ph; | 120 base::ProcessHandle ph; |
121 CommandLine cl(exe_path); | 121 CommandLine cl(exe_path); |
122 cl.AppendSwitchWithValue(param, value); | 122 cl.AppendSwitchWithValue(param, value); |
| 123 |
| 124 CommandLine* browser_command_line = CommandLine::ForCurrentProcess(); |
| 125 if (browser_command_line->HasSwitch(switches::kChromeFrame)) { |
| 126 cl.AppendSwitch(switches::kChromeFrame); |
| 127 } |
| 128 |
123 if (!base::LaunchApp(cl, false, false, &ph)) | 129 if (!base::LaunchApp(cl, false, false, &ph)) |
124 return false; | 130 return false; |
125 DWORD wr = ::WaitForSingleObject(ph, INFINITE); | 131 DWORD wr = ::WaitForSingleObject(ph, INFINITE); |
126 if (wr != WAIT_OBJECT_0) | 132 if (wr != WAIT_OBJECT_0) |
127 return false; | 133 return false; |
128 return (TRUE == ::GetExitCodeProcess(ph, reinterpret_cast<DWORD*>(ret_code))); | 134 return (TRUE == ::GetExitCodeProcess(ph, reinterpret_cast<DWORD*>(ret_code))); |
129 } | 135 } |
130 | 136 |
131 bool WriteEULAtoTempFile(FilePath* eula_path) { | 137 bool WriteEULAtoTempFile(FilePath* eula_path) { |
132 std::string terms = | 138 std::string terms = |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 // Since ImportSettings is called before the local state is stored on disk | 580 // Since ImportSettings is called before the local state is stored on disk |
575 // we pass the language as an argument. GetApplicationLocale checks the | 581 // we pass the language as an argument. GetApplicationLocale checks the |
576 // current command line as fallback. | 582 // current command line as fallback. |
577 import_cmd.AppendSwitchWithValue( | 583 import_cmd.AppendSwitchWithValue( |
578 switches::kLang, | 584 switches::kLang, |
579 ASCIIToWide(g_browser_process->GetApplicationLocale())); | 585 ASCIIToWide(g_browser_process->GetApplicationLocale())); |
580 | 586 |
581 import_cmd.CommandLine::AppendSwitchWithValue(switches::kImport, | 587 import_cmd.CommandLine::AppendSwitchWithValue(switches::kImport, |
582 EncodeImportParams(browser_type, items_to_import, parent_window)); | 588 EncodeImportParams(browser_type, items_to_import, parent_window)); |
583 | 589 |
| 590 if (cmdline.HasSwitch(switches::kChromeFrame)) { |
| 591 import_cmd.AppendSwitch(switches::kChromeFrame); |
| 592 } |
| 593 |
584 // Time to launch the process that is going to do the import. | 594 // Time to launch the process that is going to do the import. |
585 base::ProcessHandle import_process; | 595 base::ProcessHandle import_process; |
586 if (!base::LaunchApp(import_cmd, false, false, &import_process)) | 596 if (!base::LaunchApp(import_cmd, false, false, &import_process)) |
587 return false; | 597 return false; |
588 | 598 |
589 // Activate the importer monitor. It awakes periodically in another thread | 599 // Activate the importer monitor. It awakes periodically in another thread |
590 // and checks that the importer UI is still pumping messages. | 600 // and checks that the importer UI is still pumping messages. |
591 if (parent_window) | 601 if (parent_window) |
592 HungImporterMonitor hang_monitor(parent_window, import_process); | 602 HungImporterMonitor hang_monitor(parent_window, import_process); |
593 | 603 |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 | 959 |
950 DISALLOW_COPY_AND_ASSIGN(TryChromeDialog); | 960 DISALLOW_COPY_AND_ASSIGN(TryChromeDialog); |
951 }; | 961 }; |
952 | 962 |
953 } // namespace | 963 } // namespace |
954 | 964 |
955 Upgrade::TryResult Upgrade::ShowTryChromeDialog(size_t version) { | 965 Upgrade::TryResult Upgrade::ShowTryChromeDialog(size_t version) { |
956 TryChromeDialog td(version); | 966 TryChromeDialog td(version); |
957 return td.ShowModal(); | 967 return td.ShowModal(); |
958 } | 968 } |
OLD | NEW |