diff options
author | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-11 03:39:04 +0000 |
---|---|---|
committer | gab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-11 03:39:04 +0000 |
commit | 9174af4ea0610a8c7e5b9a453d8c13c7d3ce9c37 (patch) | |
tree | 2ed34b54b220a192275df4430d3739c3a8afc540 /chrome/installer/setup/uninstall.cc | |
parent | 5dc51db8c43f41e6733695644a66017cf043673a (diff) | |
download | chromium_src-9174af4ea0610a8c7e5b9a453d8c13c7d3ce9c37.zip chromium_src-9174af4ea0610a8c7e5b9a453d8c13c7d3ce9c37.tar.gz chromium_src-9174af4ea0610a8c7e5b9a453d8c13c7d3ce9c37.tar.bz2 |
C++ reability review for gab.
Added class ScopedTokenPrivilege in setup_util.[h|cc] to allow elevation of a process' privilege in the current scope while making sure we don't keep the privilege later (as these powerful privileges should be held for as little time as possible). This class is used in uninstall.cc and tested in setup_util_unittest.cc; I left the other files around for you to understand where this all hooks up.
Original review: https://chromiumcodereview.appspot.com/10810021/
I added an illegal (no space after //) comment to each file for them to be picked up. I will remove at the end (and the CQ will also make sure I do as this currently fails presubmit checks).
BUG=146850 (taking on this team refactoring task as part of this readability review).
Review URL: https://chromiumcodereview.appspot.com/10912096
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@155941 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/setup/uninstall.cc')
-rw-r--r-- | chrome/installer/setup/uninstall.cc | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index a73a7f6..4611a2c 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -132,7 +132,7 @@ void ProcessOnOsUpgradeWorkItems( const installer::Product& product) { scoped_ptr<WorkItemList> work_item_list( WorkItem::CreateNoRollbackWorkItemList()); - AddOsUpgradeWorkItems(installer_state, NULL, NULL, product, + AddOsUpgradeWorkItems(installer_state, FilePath(), Version(), product, work_item_list.get()); if (!work_item_list->Do()) LOG(ERROR) << "Failed to remove on-os-upgrade command."; @@ -146,11 +146,12 @@ void ProcessQuickEnableWorkItems( scoped_ptr<WorkItemList> work_item_list( WorkItem::CreateNoRollbackWorkItemList()); - AddQuickEnableChromeFrameWorkItems(installer_state, machine_state, NULL, NULL, - work_item_list.get()); + AddQuickEnableChromeFrameWorkItems(installer_state, machine_state, FilePath(), + Version(), work_item_list.get()); - AddQuickEnableApplicationHostWorkItems(installer_state, machine_state, NULL, - NULL, work_item_list.get()); + AddQuickEnableApplicationHostWorkItems(installer_state, machine_state, + FilePath(), Version(), + work_item_list.get()); if (!work_item_list->Do()) LOG(ERROR) << "Failed to update quick-enable-cf command."; } @@ -283,18 +284,21 @@ void DeleteChromeShortcuts(const InstallerState& installer_state, ShellUtil::SHORTCUT_ALTERNATE); } - ShellUtil::RemoveChromeQuickLaunchShortcut(product.distribution(), + ShellUtil::RemoveChromeQuickLaunchShortcut( + product.distribution(), ShellUtil::CURRENT_USER | ShellUtil::SYSTEM_LEVEL); } else { PathService::Get(base::DIR_START_MENU, &shortcut_path); - if (!ShellUtil::RemoveChromeDesktopShortcut(product.distribution(), + if (!ShellUtil::RemoveChromeDesktopShortcut( + product.distribution(), ShellUtil::CURRENT_USER, ShellUtil::SHORTCUT_NO_OPTIONS)) { - ShellUtil::RemoveChromeDesktopShortcut(product.distribution(), + ShellUtil::RemoveChromeDesktopShortcut( + product.distribution(), ShellUtil::CURRENT_USER, ShellUtil::SHORTCUT_ALTERNATE); } - ShellUtil::RemoveChromeQuickLaunchShortcut(product.distribution(), - ShellUtil::CURRENT_USER); + ShellUtil::RemoveChromeQuickLaunchShortcut( + product.distribution(), ShellUtil::CURRENT_USER); } if (shortcut_path.empty()) { LOG(ERROR) << "Failed to get location for shortcut."; @@ -677,7 +681,8 @@ bool DeleteChromeRegistrationKeys(BrowserDistribution* dist, HKEY root, } // Delete Software\RegisteredApplications\Chromium - InstallUtil::DeleteRegistryValue(root, ShellUtil::kRegRegisteredApplications, + InstallUtil::DeleteRegistryValue( + root, ShellUtil::kRegRegisteredApplications, dist->GetBaseAppName() + browser_entry_suffix); // Delete the App Paths and Applications keys that let Explorer find Chrome: |