Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: chrome/installer/setup/uninstall.cc

Issue 10912096: C++ reability review for gab. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile errors Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/installer/setup/setup_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 bool success = update_list->Do(); 125 bool success = update_list->Do();
126 LOG_IF(ERROR, !success) << "Failed updating channel values."; 126 LOG_IF(ERROR, !success) << "Failed updating channel values.";
127 } 127 }
128 } 128 }
129 129
130 void ProcessOnOsUpgradeWorkItems( 130 void ProcessOnOsUpgradeWorkItems(
131 const installer::InstallerState& installer_state, 131 const installer::InstallerState& installer_state,
132 const installer::Product& product) { 132 const installer::Product& product) {
133 scoped_ptr<WorkItemList> work_item_list( 133 scoped_ptr<WorkItemList> work_item_list(
134 WorkItem::CreateNoRollbackWorkItemList()); 134 WorkItem::CreateNoRollbackWorkItemList());
135 AddOsUpgradeWorkItems(installer_state, NULL, NULL, product, 135 AddOsUpgradeWorkItems(installer_state, FilePath(), Version(), product,
136 work_item_list.get()); 136 work_item_list.get());
137 if (!work_item_list->Do()) 137 if (!work_item_list->Do())
138 LOG(ERROR) << "Failed to remove on-os-upgrade command."; 138 LOG(ERROR) << "Failed to remove on-os-upgrade command.";
139 } 139 }
140 140
141 // Adds or removes the quick-enable-cf command to the binaries' version key in 141 // Adds or removes the quick-enable-cf command to the binaries' version key in
142 // the registry as needed. 142 // the registry as needed.
143 void ProcessQuickEnableWorkItems( 143 void ProcessQuickEnableWorkItems(
144 const installer::InstallerState& installer_state, 144 const installer::InstallerState& installer_state,
145 const installer::InstallationState& machine_state) { 145 const installer::InstallationState& machine_state) {
146 scoped_ptr<WorkItemList> work_item_list( 146 scoped_ptr<WorkItemList> work_item_list(
147 WorkItem::CreateNoRollbackWorkItemList()); 147 WorkItem::CreateNoRollbackWorkItemList());
148 148
149 AddQuickEnableChromeFrameWorkItems(installer_state, machine_state, NULL, NULL, 149 AddQuickEnableChromeFrameWorkItems(installer_state, machine_state, FilePath(),
150 work_item_list.get()); 150 Version(), work_item_list.get());
151 151
152 AddQuickEnableApplicationHostWorkItems(installer_state, machine_state, NULL, 152 AddQuickEnableApplicationHostWorkItems(installer_state, machine_state,
153 NULL, work_item_list.get()); 153 FilePath(), Version(),
154 work_item_list.get());
154 if (!work_item_list->Do()) 155 if (!work_item_list->Do())
155 LOG(ERROR) << "Failed to update quick-enable-cf command."; 156 LOG(ERROR) << "Failed to update quick-enable-cf command.";
156 } 157 }
157 158
158 void ProcessIELowRightsPolicyWorkItems( 159 void ProcessIELowRightsPolicyWorkItems(
159 const installer::InstallerState& installer_state) { 160 const installer::InstallerState& installer_state) {
160 scoped_ptr<WorkItemList> work_items(WorkItem::CreateNoRollbackWorkItemList()); 161 scoped_ptr<WorkItemList> work_items(WorkItem::CreateNoRollbackWorkItemList());
161 AddDeleteOldIELowRightsPolicyWorkItems(installer_state, work_items.get()); 162 AddDeleteOldIELowRightsPolicyWorkItems(installer_state, work_items.get());
162 work_items->Do(); 163 work_items->Do();
163 installer::RefreshElevationPolicy(); 164 installer::RefreshElevationPolicy();
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 if (!ShellUtil::RemoveChromeDesktopShortcut( 277 if (!ShellUtil::RemoveChromeDesktopShortcut(
277 product.distribution(), 278 product.distribution(),
278 ShellUtil::CURRENT_USER | ShellUtil::SYSTEM_LEVEL, 279 ShellUtil::CURRENT_USER | ShellUtil::SYSTEM_LEVEL,
279 ShellUtil::SHORTCUT_NO_OPTIONS)) { 280 ShellUtil::SHORTCUT_NO_OPTIONS)) {
280 ShellUtil::RemoveChromeDesktopShortcut( 281 ShellUtil::RemoveChromeDesktopShortcut(
281 product.distribution(), 282 product.distribution(),
282 ShellUtil::CURRENT_USER | ShellUtil::SYSTEM_LEVEL, 283 ShellUtil::CURRENT_USER | ShellUtil::SYSTEM_LEVEL,
283 ShellUtil::SHORTCUT_ALTERNATE); 284 ShellUtil::SHORTCUT_ALTERNATE);
284 } 285 }
285 286
286 ShellUtil::RemoveChromeQuickLaunchShortcut(product.distribution(), 287 ShellUtil::RemoveChromeQuickLaunchShortcut(
288 product.distribution(),
287 ShellUtil::CURRENT_USER | ShellUtil::SYSTEM_LEVEL); 289 ShellUtil::CURRENT_USER | ShellUtil::SYSTEM_LEVEL);
288 } else { 290 } else {
289 PathService::Get(base::DIR_START_MENU, &shortcut_path); 291 PathService::Get(base::DIR_START_MENU, &shortcut_path);
290 if (!ShellUtil::RemoveChromeDesktopShortcut(product.distribution(), 292 if (!ShellUtil::RemoveChromeDesktopShortcut(
293 product.distribution(),
291 ShellUtil::CURRENT_USER, ShellUtil::SHORTCUT_NO_OPTIONS)) { 294 ShellUtil::CURRENT_USER, ShellUtil::SHORTCUT_NO_OPTIONS)) {
292 ShellUtil::RemoveChromeDesktopShortcut(product.distribution(), 295 ShellUtil::RemoveChromeDesktopShortcut(
296 product.distribution(),
293 ShellUtil::CURRENT_USER, ShellUtil::SHORTCUT_ALTERNATE); 297 ShellUtil::CURRENT_USER, ShellUtil::SHORTCUT_ALTERNATE);
294 } 298 }
295 299
296 ShellUtil::RemoveChromeQuickLaunchShortcut(product.distribution(), 300 ShellUtil::RemoveChromeQuickLaunchShortcut(
297 ShellUtil::CURRENT_USER); 301 product.distribution(), ShellUtil::CURRENT_USER);
298 } 302 }
299 if (shortcut_path.empty()) { 303 if (shortcut_path.empty()) {
300 LOG(ERROR) << "Failed to get location for shortcut."; 304 LOG(ERROR) << "Failed to get location for shortcut.";
301 } else { 305 } else {
302 const string16 product_name(product.distribution()->GetAppShortCutName()); 306 const string16 product_name(product.distribution()->GetAppShortCutName());
303 shortcut_path = shortcut_path.Append(product_name); 307 shortcut_path = shortcut_path.Append(product_name);
304 308
305 FilePath shortcut_link(shortcut_path.Append(product_name + L".lnk")); 309 FilePath shortcut_link(shortcut_path.Append(product_name + L".lnk"));
306 310
307 VLOG(1) << "Unpinning shortcut at " << shortcut_link.value() 311 VLOG(1) << "Unpinning shortcut at " << shortcut_link.value()
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after
670 HKEY_USERS, 674 HKEY_USERS,
671 string16(L".DEFAULT\\").append( 675 string16(L".DEFAULT\\").append(
672 ShellUtil::kRegStartMenuInternet).c_str(), 676 ShellUtil::kRegStartMenuInternet).c_str(),
673 L"", InstallUtil::ValueEquals(client_name)); 677 L"", InstallUtil::ValueEquals(client_name));
674 } 678 }
675 } 679 }
676 } 680 }
677 } 681 }
678 682
679 // Delete Software\RegisteredApplications\Chromium 683 // Delete Software\RegisteredApplications\Chromium
680 InstallUtil::DeleteRegistryValue(root, ShellUtil::kRegRegisteredApplications, 684 InstallUtil::DeleteRegistryValue(
685 root, ShellUtil::kRegRegisteredApplications,
681 dist->GetBaseAppName() + browser_entry_suffix); 686 dist->GetBaseAppName() + browser_entry_suffix);
682 687
683 // Delete the App Paths and Applications keys that let Explorer find Chrome: 688 // Delete the App Paths and Applications keys that let Explorer find Chrome:
684 // http://msdn.microsoft.com/en-us/library/windows/desktop/ee872121 689 // http://msdn.microsoft.com/en-us/library/windows/desktop/ee872121
685 string16 app_key(ShellUtil::kRegClasses); 690 string16 app_key(ShellUtil::kRegClasses);
686 app_key.push_back(FilePath::kSeparators[0]); 691 app_key.push_back(FilePath::kSeparators[0]);
687 app_key.append(L"Applications"); 692 app_key.append(L"Applications");
688 app_key.push_back(FilePath::kSeparators[0]); 693 app_key.push_back(FilePath::kSeparators[0]);
689 app_key.append(installer::kChromeExe); 694 app_key.append(installer::kChromeExe);
690 InstallUtil::DeleteRegistryKey(root, app_key); 695 InstallUtil::DeleteRegistryKey(root, app_key);
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 1204
1200 // Try and delete the preserved local state once the post-install 1205 // Try and delete the preserved local state once the post-install
1201 // operations are complete. 1206 // operations are complete.
1202 if (!backup_state_file.empty()) 1207 if (!backup_state_file.empty())
1203 file_util::Delete(backup_state_file, false); 1208 file_util::Delete(backup_state_file, false);
1204 1209
1205 return ret; 1210 return ret;
1206 } 1211 }
1207 1212
1208 } // namespace installer 1213 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/setup/setup_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698