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

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

Issue 10909171: Fix and re-commit -- Refactoring and tests for file_util::CreateOrUpdateShortcutLink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Delay load propsys.dll for exes that depend on test_support_base as it doesn't exist on WinXP 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/install.cc ('k') | chrome/installer/util/shell_util.h » ('j') | 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
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/file_util.h" 13 #include "base/file_util.h"
14 #include "base/path_service.h" 14 #include "base/path_service.h"
15 #include "base/process_util.h" 15 #include "base/process_util.h"
16 #include "base/string16.h" 16 #include "base/string16.h"
17 #include "base/string_number_conversions.h" 17 #include "base/string_number_conversions.h"
18 #include "base/string_util.h" 18 #include "base/string_util.h"
19 #include "base/utf_string_conversions.h" 19 #include "base/utf_string_conversions.h"
20 #include "base/win/registry.h" 20 #include "base/win/registry.h"
21 #include "base/win/scoped_handle.h" 21 #include "base/win/scoped_handle.h"
22 #include "base/win/shortcut.h"
22 #include "base/win/windows_version.h" 23 #include "base/win/windows_version.h"
23 #include "chrome/common/chrome_constants.h" 24 #include "chrome/common/chrome_constants.h"
24 #include "chrome/common/chrome_paths_internal.h" 25 #include "chrome/common/chrome_paths_internal.h"
25 #include "chrome/common/chrome_result_codes.h" 26 #include "chrome/common/chrome_result_codes.h"
26 #include "chrome/installer/setup/install.h" 27 #include "chrome/installer/setup/install.h"
27 #include "chrome/installer/setup/install_worker.h" 28 #include "chrome/installer/setup/install_worker.h"
28 #include "chrome/installer/setup/setup_constants.h" 29 #include "chrome/installer/setup/setup_constants.h"
29 #include "chrome/installer/setup/setup_util.h" 30 #include "chrome/installer/setup/setup_util.h"
30 #include "chrome/installer/util/auto_launch_util.h" 31 #include "chrome/installer/util/auto_launch_util.h"
31 #include "chrome/installer/util/browser_distribution.h" 32 #include "chrome/installer/util/browser_distribution.h"
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 LOG(ERROR) << "Failed to get location for shortcut."; 305 LOG(ERROR) << "Failed to get location for shortcut.";
305 } else { 306 } else {
306 const string16 product_name(product.distribution()->GetAppShortCutName()); 307 const string16 product_name(product.distribution()->GetAppShortCutName());
307 shortcut_path = shortcut_path.Append(product_name); 308 shortcut_path = shortcut_path.Append(product_name);
308 309
309 FilePath shortcut_link(shortcut_path.Append(product_name + L".lnk")); 310 FilePath shortcut_link(shortcut_path.Append(product_name + L".lnk"));
310 311
311 VLOG(1) << "Unpinning shortcut at " << shortcut_link.value() 312 VLOG(1) << "Unpinning shortcut at " << shortcut_link.value()
312 << " from taskbar"; 313 << " from taskbar";
313 // Ignore return value: keep uninstalling if the unpin fails. 314 // Ignore return value: keep uninstalling if the unpin fails.
314 file_util::TaskbarUnpinShortcutLink(shortcut_link.value().c_str()); 315 base::win::TaskbarUnpinShortcutLink(shortcut_link.value().c_str());
315 316
316 VLOG(1) << "Deleting shortcut " << shortcut_path.value(); 317 VLOG(1) << "Deleting shortcut " << shortcut_path.value();
317 if (!file_util::Delete(shortcut_path, true)) 318 if (!file_util::Delete(shortcut_path, true))
318 LOG(ERROR) << "Failed to delete folder: " << shortcut_path.value(); 319 LOG(ERROR) << "Failed to delete folder: " << shortcut_path.value();
319 } 320 }
320 321
321 ShellUtil::RemoveChromeStartScreenShortcuts(product.distribution(), 322 ShellUtil::RemoveChromeStartScreenShortcuts(product.distribution(),
322 chrome_exe); 323 chrome_exe);
323 } 324 }
324 325
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1204 1205
1205 // Try and delete the preserved local state once the post-install 1206 // Try and delete the preserved local state once the post-install
1206 // operations are complete. 1207 // operations are complete.
1207 if (!backup_state_file.empty()) 1208 if (!backup_state_file.empty())
1208 file_util::Delete(backup_state_file, false); 1209 file_util::Delete(backup_state_file, false);
1209 1210
1210 return ret; 1211 return ret;
1211 } 1212 }
1212 1213
1213 } // namespace installer 1214 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/setup/install.cc ('k') | chrome/installer/util/shell_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698