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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 DWORD exit_code; | 103 DWORD exit_code; |
104 ::GetExitCodeProcess(handle, &exit_code); | 104 ::GetExitCodeProcess(handle, &exit_code); |
105 ::CloseHandle(handle); | 105 ::CloseHandle(handle); |
106 if (exit_code == installer_util::RENAME_SUCCESSFUL) | 106 if (exit_code == installer_util::RENAME_SUCCESSFUL) |
107 return true; | 107 return true; |
108 } | 108 } |
109 } | 109 } |
110 return false; | 110 return false; |
111 } | 111 } |
112 | 112 |
113 bool LaunchSetupWithParam(const std::wstring& 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.ToWStringHack()); | 121 CommandLine cl(exe_path.ToWStringHack()); |
122 cl.AppendSwitchWithValue(param, value); | 122 cl.AppendSwitchWithValue(param, value); |
123 if (!base::LaunchApp(cl, false, false, &ph)) | 123 if (!base::LaunchApp(cl, false, false, &ph)) |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 installer_util::master_preferences::kRequireEula)) { | 201 installer_util::master_preferences::kRequireEula)) { |
202 // Show the post-installation EULA. This is done by setup.exe and the | 202 // Show the post-installation EULA. This is done by setup.exe and the |
203 // result determines if we continue or not. We wait here until the user | 203 // result determines if we continue or not. We wait here until the user |
204 // dismisses the dialog. | 204 // dismisses the dialog. |
205 | 205 |
206 // The actual eula text is in a resource in chrome. We extract it to | 206 // The actual eula text is in a resource in chrome. We extract it to |
207 // a text file so setup.exe can use it as an inner frame. | 207 // a text file so setup.exe can use it as an inner frame. |
208 FilePath inner_html; | 208 FilePath inner_html; |
209 if (WriteEULAtoTempFile(&inner_html)) { | 209 if (WriteEULAtoTempFile(&inner_html)) { |
210 int retcode = 0; | 210 int retcode = 0; |
211 const std::wstring& eula = installer_util::switches::kShowEula; | 211 const std::string eula = WideToASCII(installer_util::switches::kShowEula); |
212 if (!LaunchSetupWithParam(eula, inner_html.ToWStringHack(), &retcode) || | 212 if (!LaunchSetupWithParam(eula, inner_html.ToWStringHack(), &retcode) || |
213 (retcode == installer_util::EULA_REJECTED)) { | 213 (retcode == installer_util::EULA_REJECTED)) { |
214 LOG(WARNING) << "EULA rejected. Fast exit."; | 214 LOG(WARNING) << "EULA rejected. Fast exit."; |
215 ::ExitProcess(1); | 215 ::ExitProcess(1); |
216 } | 216 } |
217 if (retcode == installer_util::EULA_ACCEPTED) { | 217 if (retcode == installer_util::EULA_ACCEPTED) { |
218 LOG(INFO) << "EULA : no collection"; | 218 LOG(INFO) << "EULA : no collection"; |
219 GoogleUpdateSettings::SetCollectStatsConsent(false); | 219 GoogleUpdateSettings::SetCollectStatsConsent(false); |
220 } else if (retcode == installer_util::EULA_ACCEPTED_OPT_IN) { | 220 } else if (retcode == installer_util::EULA_ACCEPTED_OPT_IN) { |
221 LOG(INFO) << "EULA : collection consent"; | 221 LOG(INFO) << "EULA : collection consent"; |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
922 | 922 |
923 DISALLOW_COPY_AND_ASSIGN(TryChromeDialog); | 923 DISALLOW_COPY_AND_ASSIGN(TryChromeDialog); |
924 }; | 924 }; |
925 | 925 |
926 } // namespace | 926 } // namespace |
927 | 927 |
928 Upgrade::TryResult Upgrade::ShowTryChromeDialog(size_t version) { | 928 Upgrade::TryResult Upgrade::ShowTryChromeDialog(size_t version) { |
929 TryChromeDialog td(version); | 929 TryChromeDialog td(version); |
930 return td.ShowModal(); | 930 return td.ShowModal(); |
931 } | 931 } |
OLD | NEW |