diff options
author | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-05 21:23:36 +0000 |
---|---|---|
committer | maruel@google.com <maruel@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-05 21:23:36 +0000 |
commit | 06fcf9223e647a8d26b0a2f18d6ff2385bef4fb7 (patch) | |
tree | 1a9c113b9b72f1d88f284166f095256eeb813185 /chrome | |
parent | 3178f4e296e24781be5fbcc4ba91815e08c78897 (diff) | |
download | chromium_src-06fcf9223e647a8d26b0a2f18d6ff2385bef4fb7.zip chromium_src-06fcf9223e647a8d26b0a2f18d6ff2385bef4fb7.tar.gz chromium_src-06fcf9223e647a8d26b0a2f18d6ff2385bef4fb7.tar.bz2 |
Reapply revision 380 since it wasn't the cause of the build breakage.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@394 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/result_codes.h | 2 | ||||
-rw-r--r-- | chrome/browser/browser_main.cc | 6 | ||||
-rw-r--r-- | chrome/installer/setup/uninstall.cc | 24 |
3 files changed, 19 insertions, 13 deletions
diff --git a/chrome/app/result_codes.h b/chrome/app/result_codes.h index 9e8ff2f..8ba12aa 100644 --- a/chrome/app/result_codes.h +++ b/chrome/app/result_codes.h @@ -52,7 +52,7 @@ class ResultCodes { MISSING_PATH, // An critical chrome path is missing. MISSING_DATA, // A critical chrome file is missing. SHELL_INTEGRATION_FAILED, // Failed to make Chrome default browser. - UNINSTALL_ERROR, // Unspecified error while uninstalling. + UNINSTALL_DELETE_FILE_ERROR,// Error while deleting shortcuts. UNINSTALL_CHROME_ALIVE, // Uninstall detected another chrome instance. UNINSTALL_NO_SURVEY, // Do not launch survey after uninstall. UNINSTALL_USER_CANCEL, // The user changed her mind. diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 057e254..686be7c 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -182,11 +182,11 @@ int DoUninstallTasks() { LOG(INFO) << "Executing uninstall actions"; ResultCodes::ExitCode ret = ResultCodes::NORMAL_EXIT; if (!FirstRun::RemoveSentinel()) - ret = ResultCodes::UNINSTALL_ERROR; + ret = ResultCodes::UNINSTALL_DELETE_FILE_ERROR; if (!FirstRun::RemoveChromeDesktopShortcut()) - ret = ResultCodes::UNINSTALL_ERROR; + ret = ResultCodes::UNINSTALL_DELETE_FILE_ERROR; if (!FirstRun::RemoveChromeQuickLaunchShortcut()) - ret = ResultCodes::UNINSTALL_ERROR; + ret = ResultCodes::UNINSTALL_DELETE_FILE_ERROR; return ret; } diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index 9403a8a..d742e62 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -119,8 +119,12 @@ installer_util::InstallStatus IsChromeActiveOrUserCancelled( int32 exit_code = ResultCodes::NORMAL_EXIT; bool is_timeout = false; - // We ignore all other errors such as whether launching chrome fails, - // whether chrome returns UNINSTALL_ERROR, etc. + // We want to continue with the uninstallation only when chrome.exe either + // returns NORMAL_EXIT (means Chrome is not running, user has confirmed + // uninstallation and sentinel file/desktop/ql shortcuts have been + // cleaned up) or UNINSTALL_DELETE_FILE_ERROR (means Chrome is not running, + // user has confirmed uninstallation but there was a problem with deleting + // sentinel file, desktop or ql shortcuts). LOG(INFO) << "Launching Chrome to do uninstall tasks."; if (installer::LaunchChromeAndWaitForResult(system_uninstall, kCmdLineOptions, @@ -128,18 +132,21 @@ installer_util::InstallStatus IsChromeActiveOrUserCancelled( &exit_code, &is_timeout)) { if (is_timeout || exit_code == ResultCodes::UNINSTALL_CHROME_ALIVE) { - LOG(ERROR) << "Can't uninstall when chrome is still running"; + LOG(INFO) << "Can't uninstall when chrome is still running"; return installer_util::CHROME_RUNNING; } else if (exit_code == ResultCodes::UNINSTALL_USER_CANCEL) { LOG(INFO) << "User cancelled uninstall operation"; return installer_util::UNINSTALL_CANCELLED; - } else if (exit_code == ResultCodes::UNINSTALL_ERROR) { - LOG(ERROR) << "chrome.exe reported error while uninstalling."; - return installer_util::UNINSTALL_FAILED; + } else if (exit_code == ResultCodes::NORMAL_EXIT) { + LOG(INFO) << "chrome.exe confirmed uninstallation from user."; + return installer_util::UNINSTALL_CONFIRMED; + } else if (exit_code == ResultCodes::UNINSTALL_DELETE_FILE_ERROR) { + LOG(ERROR) << "chrome.exe returned delete file error."; + return installer_util::UNINSTALL_CONFIRMED; } } - return installer_util::UNINSTALL_CONFIRMED; + return installer_util::UNINSTALL_FAILED; } // Read the URL from the resource file and substitute the locale parameter @@ -222,8 +229,7 @@ installer_util::InstallStatus installer_setup::UninstallChrome( const installer::Version& installed_version, bool remove_all) { installer_util::InstallStatus status = IsChromeActiveOrUserCancelled(system_uninstall); - if (status == installer_util::CHROME_RUNNING || - status == installer_util::UNINSTALL_CANCELLED) + if (status != installer_util::UNINSTALL_CONFIRMED) return status; // Uninstall Gears first. |