| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file defines the methods useful for uninstalling Chrome. | 5 // This file defines the methods useful for uninstalling Chrome. |
| 6 | 6 |
| 7 #include "chrome/installer/setup/uninstall.h" | 7 #include "chrome/installer/setup/uninstall.h" |
| 8 | 8 |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 const installer::InstallerState& installer_state, | 153 const installer::InstallerState& installer_state, |
| 154 const installer::Product& product) { | 154 const installer::Product& product) { |
| 155 scoped_ptr<WorkItemList> work_item_list( | 155 scoped_ptr<WorkItemList> work_item_list( |
| 156 WorkItem::CreateNoRollbackWorkItemList()); | 156 WorkItem::CreateNoRollbackWorkItemList()); |
| 157 AddOsUpgradeWorkItems(installer_state, base::FilePath(), Version(), product, | 157 AddOsUpgradeWorkItems(installer_state, base::FilePath(), Version(), product, |
| 158 work_item_list.get()); | 158 work_item_list.get()); |
| 159 if (!work_item_list->Do()) | 159 if (!work_item_list->Do()) |
| 160 LOG(ERROR) << "Failed to remove on-os-upgrade command."; | 160 LOG(ERROR) << "Failed to remove on-os-upgrade command."; |
| 161 } | 161 } |
| 162 | 162 |
| 163 // Adds or removes the quick-enable-cf command to the binaries' version key in | |
| 164 // the registry as needed. | |
| 165 void ProcessQuickEnableWorkItems( | |
| 166 const installer::InstallerState& installer_state, | |
| 167 const installer::InstallationState& machine_state) { | |
| 168 scoped_ptr<WorkItemList> work_item_list( | |
| 169 WorkItem::CreateNoRollbackWorkItemList()); | |
| 170 | |
| 171 AddQuickEnableChromeFrameWorkItems(installer_state, machine_state, | |
| 172 base::FilePath(), | |
| 173 Version(), work_item_list.get()); | |
| 174 | |
| 175 if (!work_item_list->Do()) | |
| 176 LOG(ERROR) << "Failed to update quick-enable-cf command."; | |
| 177 } | |
| 178 | |
| 179 void ProcessIELowRightsPolicyWorkItems( | 163 void ProcessIELowRightsPolicyWorkItems( |
| 180 const installer::InstallerState& installer_state) { | 164 const installer::InstallerState& installer_state) { |
| 181 scoped_ptr<WorkItemList> work_items(WorkItem::CreateNoRollbackWorkItemList()); | 165 scoped_ptr<WorkItemList> work_items(WorkItem::CreateNoRollbackWorkItemList()); |
| 182 AddDeleteOldIELowRightsPolicyWorkItems(installer_state, work_items.get()); | 166 AddDeleteOldIELowRightsPolicyWorkItems(installer_state, work_items.get()); |
| 183 work_items->Do(); | 167 work_items->Do(); |
| 184 installer::RefreshElevationPolicy(); | 168 installer::RefreshElevationPolicy(); |
| 185 } | 169 } |
| 186 | 170 |
| 187 void ClearRlzProductState() { | 171 void ClearRlzProductState() { |
| 188 const rlz_lib::AccessPoint points[] = {rlz_lib::CHROME_OMNIBOX, | 172 const rlz_lib::AccessPoint points[] = {rlz_lib::CHROME_OMNIBOX, |
| (...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1258 if (!has_legacy_app_launcher) { | 1242 if (!has_legacy_app_launcher) { |
| 1259 BrowserDistribution* shadow_app_launcher_dist = | 1243 BrowserDistribution* shadow_app_launcher_dist = |
| 1260 BrowserDistribution::GetSpecificDistribution( | 1244 BrowserDistribution::GetSpecificDistribution( |
| 1261 BrowserDistribution::CHROME_APP_HOST); | 1245 BrowserDistribution::CHROME_APP_HOST); |
| 1262 InstallUtil::DeleteRegistryKey(reg_root, | 1246 InstallUtil::DeleteRegistryKey(reg_root, |
| 1263 shadow_app_launcher_dist->GetVersionKey()); | 1247 shadow_app_launcher_dist->GetVersionKey()); |
| 1264 } | 1248 } |
| 1265 } | 1249 } |
| 1266 } | 1250 } |
| 1267 | 1251 |
| 1268 if (installer_state.is_multi_install()) { | 1252 if (installer_state.is_multi_install()) |
| 1269 ProcessGoogleUpdateItems(original_state, installer_state, product); | 1253 ProcessGoogleUpdateItems(original_state, installer_state, product); |
| 1270 | 1254 |
| 1271 ProcessQuickEnableWorkItems(installer_state, original_state); | |
| 1272 } | |
| 1273 | |
| 1274 // Get the state of the installed product (if any) | 1255 // Get the state of the installed product (if any) |
| 1275 const ProductState* product_state = | 1256 const ProductState* product_state = |
| 1276 original_state.GetProductState(installer_state.system_install(), | 1257 original_state.GetProductState(installer_state.system_install(), |
| 1277 browser_dist->GetType()); | 1258 browser_dist->GetType()); |
| 1278 | 1259 |
| 1279 // Delete shared registry keys as well (these require admin rights) if | 1260 // Delete shared registry keys as well (these require admin rights) if |
| 1280 // remove_all option is specified. | 1261 // remove_all option is specified. |
| 1281 if (remove_all) { | 1262 if (remove_all) { |
| 1282 if (!InstallUtil::IsChromeSxSProcess() && is_chrome) { | 1263 if (!InstallUtil::IsChromeSxSProcess() && is_chrome) { |
| 1283 // Delete media player registry key that exists only in HKLM. | 1264 // Delete media player registry key that exists only in HKLM. |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1435 // If we need a reboot to continue, schedule the parent directories for | 1416 // If we need a reboot to continue, schedule the parent directories for |
| 1436 // deletion unconditionally. If they are not empty, the session manager | 1417 // deletion unconditionally. If they are not empty, the session manager |
| 1437 // will not delete them on reboot. | 1418 // will not delete them on reboot. |
| 1438 ScheduleParentAndGrandparentForDeletion(target_path); | 1419 ScheduleParentAndGrandparentForDeletion(target_path); |
| 1439 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { | 1420 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { |
| 1440 *uninstall_status = UNINSTALL_FAILED; | 1421 *uninstall_status = UNINSTALL_FAILED; |
| 1441 } | 1422 } |
| 1442 } | 1423 } |
| 1443 | 1424 |
| 1444 } // namespace installer | 1425 } // namespace installer |
| OLD | NEW |