OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_main.h" | 5 #include "chrome/browser/browser_main.h" |
6 #include "chrome/browser/browser_main_win.h" | 6 #include "chrome/browser/browser_main_win.h" |
7 | 7 |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 | 10 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 std::transform(exe.begin(), exe.end(), exe.begin(), tolower); | 181 std::transform(exe.begin(), exe.end(), exe.begin(), tolower); |
182 std::wstring user_exe_path = installer::GetChromeInstallPath(false); | 182 std::wstring user_exe_path = installer::GetChromeInstallPath(false); |
183 std::transform(user_exe_path.begin(), user_exe_path.end(), | 183 std::transform(user_exe_path.begin(), user_exe_path.end(), |
184 user_exe_path.begin(), tolower); | 184 user_exe_path.begin(), tolower); |
185 if (exe == user_exe_path) { | 185 if (exe == user_exe_path) { |
186 const std::wstring text = | 186 const std::wstring text = |
187 l10n_util::GetString(IDS_MACHINE_LEVEL_INSTALL_CONFLICT); | 187 l10n_util::GetString(IDS_MACHINE_LEVEL_INSTALL_CONFLICT); |
188 const std::wstring caption = l10n_util::GetString(IDS_PRODUCT_NAME); | 188 const std::wstring caption = l10n_util::GetString(IDS_PRODUCT_NAME); |
189 const UINT flags = MB_OK | MB_ICONERROR | MB_TOPMOST; | 189 const UINT flags = MB_OK | MB_ICONERROR | MB_TOPMOST; |
190 win_util::MessageBox(NULL, text, caption, flags); | 190 win_util::MessageBox(NULL, text, caption, flags); |
191 std::wstring uninstall_cmd = InstallUtil::GetChromeUninstallCmd(false); | 191 FilePath uninstall_path(InstallUtil::GetChromeUninstallCmd(false)); |
192 if (!uninstall_cmd.empty()) { | 192 CommandLine uninstall_cmd(uninstall_path); |
193 uninstall_cmd.append(L" --"); | 193 if (!uninstall_cmd.GetProgram().value().empty()) { |
194 uninstall_cmd.append(installer_util::switches::kForceUninstall); | 194 uninstall_cmd.AppendSwitch(installer_util::switches::kForceUninstall); |
195 uninstall_cmd.append(L" --"); | 195 uninstall_cmd.AppendSwitch( |
196 uninstall_cmd.append(installer_util::switches::kDoNotRemoveSharedItems); | 196 installer_util::switches::kDoNotRemoveSharedItems); |
197 base::LaunchApp(uninstall_cmd, false, false, NULL); | 197 base::LaunchApp(uninstall_cmd, false, false, NULL); |
198 } | 198 } |
199 return true; | 199 return true; |
200 } | 200 } |
201 } | 201 } |
202 return false; | 202 return false; |
203 } | 203 } |
204 | 204 |
205 // BrowserMainPartsWin --------------------------------------------------------- | 205 // BrowserMainPartsWin --------------------------------------------------------- |
206 | 206 |
(...skipping 25 matching lines...) Expand all Loading... |
232 base::EnsureNSPRInit(); | 232 base::EnsureNSPRInit(); |
233 } | 233 } |
234 } | 234 } |
235 }; | 235 }; |
236 | 236 |
237 // static | 237 // static |
238 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( | 238 BrowserMainParts* BrowserMainParts::CreateBrowserMainParts( |
239 const MainFunctionParams& parameters) { | 239 const MainFunctionParams& parameters) { |
240 return new BrowserMainPartsWin(parameters); | 240 return new BrowserMainPartsWin(parameters); |
241 } | 241 } |
OLD | NEW |