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 |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |