diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-21 21:07:50 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-21 21:07:50 +0000 |
commit | 33a7e0838e27d9062719904c73062d499e33e8e2 (patch) | |
tree | e94da8d5d6567d0f1d1c8d56cc540ac33367c886 /chrome/browser/chrome_browser_main_win.cc | |
parent | 4f53f036e15c103549ebb654247af76c03aff332 (diff) | |
download | chromium_src-33a7e0838e27d9062719904c73062d499e33e8e2.zip chromium_src-33a7e0838e27d9062719904c73062d499e33e8e2.tar.gz chromium_src-33a7e0838e27d9062719904c73062d499e33e8e2.tar.bz2 |
Remove self-destruct message box (causing hang in Metro).
Launch self-destruct setup out of job (so that it doesn't die when killing the chrome.exe which created it...).
And be more drastic about killing Chrome processes on force-uninstall (pure kill, no wait).
BUG=158632,159995
TEST=Install system-level over user-level (with user-level set to run in Metro mode); next run should self-destruct user-level Chrome (silently); subsequent launches should launch system-level Chrome.
This should also fix users currently in this bad state (upon updating the user-level Chrome which will then be able to self-destruct properly).
This might also solve bug 159995, will need to test with official build (it definitely solves the part where when both Chromes are present, user-level is activated, but hangs on the self-destruct message (which can't be displayed in Metro) -- the stronger kill process in this CL might also help with the user-level binaries left behind issue).
Review URL: https://chromiumcodereview.appspot.com/11417036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169130 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chrome_browser_main_win.cc')
-rw-r--r-- | chrome/browser/chrome_browser_main_win.cc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc index 10ed28d..8687be6 100644 --- a/chrome/browser/chrome_browser_main_win.cc +++ b/chrome/browser/chrome_browser_main_win.cc @@ -361,18 +361,28 @@ bool ChromeBrowserMainPartsWin::CheckMachineLevelInstall() { std::wstring exe = exe_path.value(); FilePath user_exe_path(installer::GetChromeInstallPath(false, dist)); if (FilePath::CompareEqualIgnoreCase(exe, user_exe_path.value())) { - const string16 text = - l10n_util::GetStringUTF16(IDS_MACHINE_LEVEL_INSTALL_CONFLICT); - const string16 caption = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); - const UINT flags = MB_OK | MB_ICONERROR | MB_TOPMOST; - ui::MessageBox(NULL, text, caption, flags); + bool is_metro = base::win::IsMetroProcess(); + if (!is_metro) { + // The dialog cannot be shown in Win8 Metro as doing so hangs Chrome on + // an invisible dialog. + // TODO (gab): Get rid of this dialog altogether and auto-launch + // system-level Chrome instead. + const string16 text = + l10n_util::GetStringUTF16(IDS_MACHINE_LEVEL_INSTALL_CONFLICT); + const string16 caption = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); + const UINT flags = MB_OK | MB_ICONERROR | MB_TOPMOST; + ui::MessageBox(NULL, text, caption, flags); + } CommandLine uninstall_cmd( InstallUtil::GetChromeUninstallCmd(false, dist->GetType())); if (!uninstall_cmd.GetProgram().empty()) { uninstall_cmd.AppendSwitch(installer::switches::kForceUninstall); uninstall_cmd.AppendSwitch( installer::switches::kDoNotRemoveSharedItems); - base::LaunchProcess(uninstall_cmd, base::LaunchOptions(), NULL); + base::LaunchOptions launch_options; + if (is_metro) + launch_options.force_breakaway_from_job_ = true; + base::LaunchProcess(uninstall_cmd, launch_options, NULL); } return true; } |