| Index: chrome/installer/setup/uninstall.cc
|
| ===================================================================
|
| --- chrome/installer/setup/uninstall.cc (revision 76463)
|
| +++ chrome/installer/setup/uninstall.cc (working copy)
|
| @@ -101,6 +101,20 @@
|
| }
|
| }
|
|
|
| +// Adds or removes the quick-enable-cf command to the binaries' version key in
|
| +// the registry as needed.
|
| +void ProcessQuickEnableWorkItems(
|
| + const installer::InstallerState& installer_state,
|
| + const installer::InstallationState& machine_state) {
|
| + scoped_ptr<WorkItemList> work_item_list(
|
| + WorkItem::CreateNoRollbackWorkItemList());
|
| +
|
| + AddQuickEnableWorkItems(installer_state, machine_state, NULL, NULL,
|
| + work_item_list.get());
|
| + if (!work_item_list->Do())
|
| + LOG(ERROR) << "Failed to update quick-enable-cf command.";
|
| +}
|
| +
|
| } // namespace
|
|
|
| namespace installer {
|
| @@ -357,31 +371,29 @@
|
|
|
| DeleteResult DeleteFilesAndFolders(const InstallerState& installer_state,
|
| const Version& installed_version) {
|
| - VLOG(1) << "DeleteFilesAndFolders: " << installer_state.target_path().value();
|
| - if (installer_state.target_path().empty()) {
|
| - LOG(ERROR) << "Could not get installation destination path.";
|
| + const FilePath& target_path = installer_state.target_path();
|
| + if (target_path.empty()) {
|
| + LOG(ERROR) << "DeleteFilesAndFolders: no installation destination path.";
|
| return DELETE_FAILED; // Nothing else we can do to uninstall, so we return.
|
| }
|
|
|
| DeleteResult result = DELETE_SUCCEEDED;
|
|
|
| - VLOG(1) << "Deleting install path " << installer_state.target_path().value();
|
| - if (!file_util::Delete(installer_state.target_path(), true)) {
|
| - LOG(ERROR) << "Failed to delete folder (1st try): "
|
| - << installer_state.target_path().value();
|
| + VLOG(1) << "Deleting install path " << target_path.value();
|
| + if (!file_util::Delete(target_path, true)) {
|
| + LOG(ERROR) << "Failed to delete folder (1st try): " << target_path.value();
|
| if (installer_state.FindProduct(BrowserDistribution::CHROME_FRAME)) {
|
| // We don't try killing Chrome processes for Chrome Frame builds since
|
| // that is unlikely to help. Instead, schedule files for deletion and
|
| // return a value that will trigger a reboot prompt.
|
| - ScheduleDirectoryForDeletion(
|
| - installer_state.target_path().value().c_str());
|
| + ScheduleDirectoryForDeletion(target_path.value().c_str());
|
| result = DELETE_REQUIRES_REBOOT;
|
| } else {
|
| // Try closing any running chrome processes and deleting files once again.
|
| CloseAllChromeProcesses();
|
| - if (!file_util::Delete(installer_state.target_path(), true)) {
|
| + if (!file_util::Delete(target_path, true)) {
|
| LOG(ERROR) << "Failed to delete folder (2nd try): "
|
| - << installer_state.target_path().value();
|
| + << target_path.value();
|
| result = DELETE_FAILED;
|
| }
|
| }
|
| @@ -391,11 +403,11 @@
|
| // If we need a reboot to continue, schedule the parent directories for
|
| // deletion unconditionally. If they are not empty, the session manager
|
| // will not delete them on reboot.
|
| - ScheduleParentAndGrandparentForDeletion(installer_state.target_path());
|
| + ScheduleParentAndGrandparentForDeletion(target_path);
|
| } else {
|
| // Now check and delete if the parent directories are empty
|
| // For example Google\Chrome or Chromium
|
| - DeleteEmptyParentDir(installer_state.target_path());
|
| + DeleteEmptyParentDir(target_path);
|
| }
|
| return result;
|
| }
|
| @@ -465,9 +477,11 @@
|
| return true;
|
| }
|
|
|
| - RegKey key(root, L"", KEY_ALL_ACCESS);
|
| - if (!key.Valid()) {
|
| - PLOG(ERROR) << "DeleteChromeRegistrationKeys: failed to open root key";
|
| + RegKey key;
|
| + LONG result = key.Open(root, L"", KEY_ALL_ACCESS);
|
| + if (result != ERROR_SUCCESS) {
|
| + LOG(ERROR) << "DeleteChromeRegistrationKeys: failed to open root key (lec: "
|
| + << result << ").";
|
| }
|
|
|
| // Delete Software\Classes\ChromeHTML,
|
| @@ -667,6 +681,8 @@
|
| suffix, ret);
|
| }
|
|
|
| + ProcessQuickEnableWorkItems(installer_state, original_state);
|
| +
|
| // Get the state of the installed product (if any)
|
| const ProductState* product_state =
|
| original_state.GetProductState(installer_state.system_install(),
|
|
|