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 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 LOG(ERROR) << "Failed to get location for shortcut."; | 301 LOG(ERROR) << "Failed to get location for shortcut."; |
301 } else { | 302 } else { |
302 const string16 product_name(product.distribution()->GetAppShortCutName()); | 303 const string16 product_name(product.distribution()->GetAppShortCutName()); |
303 shortcut_path = shortcut_path.Append(product_name); | 304 shortcut_path = shortcut_path.Append(product_name); |
304 | 305 |
305 FilePath shortcut_link(shortcut_path.Append(product_name + L".lnk")); | 306 FilePath shortcut_link(shortcut_path.Append(product_name + L".lnk")); |
306 | 307 |
307 VLOG(1) << "Unpinning shortcut at " << shortcut_link.value() | 308 VLOG(1) << "Unpinning shortcut at " << shortcut_link.value() |
308 << " from taskbar"; | 309 << " from taskbar"; |
309 // Ignore return value: keep uninstalling if the unpin fails. | 310 // Ignore return value: keep uninstalling if the unpin fails. |
310 file_util::TaskbarUnpinShortcutLink(shortcut_link.value().c_str()); | 311 base::win::TaskbarUnpinShortcutLink(shortcut_link.value().c_str()); |
311 | 312 |
312 VLOG(1) << "Deleting shortcut " << shortcut_path.value(); | 313 VLOG(1) << "Deleting shortcut " << shortcut_path.value(); |
313 if (!file_util::Delete(shortcut_path, true)) | 314 if (!file_util::Delete(shortcut_path, true)) |
314 LOG(ERROR) << "Failed to delete folder: " << shortcut_path.value(); | 315 LOG(ERROR) << "Failed to delete folder: " << shortcut_path.value(); |
315 } | 316 } |
316 | 317 |
317 ShellUtil::RemoveChromeStartScreenShortcuts(product.distribution(), | 318 ShellUtil::RemoveChromeStartScreenShortcuts(product.distribution(), |
318 chrome_exe); | 319 chrome_exe); |
319 } | 320 } |
320 | 321 |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 | 1200 |
1200 // Try and delete the preserved local state once the post-install | 1201 // Try and delete the preserved local state once the post-install |
1201 // operations are complete. | 1202 // operations are complete. |
1202 if (!backup_state_file.empty()) | 1203 if (!backup_state_file.empty()) |
1203 file_util::Delete(backup_state_file, false); | 1204 file_util::Delete(backup_state_file, false); |
1204 | 1205 |
1205 return ret; | 1206 return ret; |
1206 } | 1207 } |
1207 | 1208 |
1208 } // namespace installer | 1209 } // namespace installer |
OLD | NEW |