OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/chrome_browser_main_win.h" | 5 #include "chrome/browser/chrome_browser_main_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
11 | 11 |
12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
13 #include "base/environment.h" | 13 #include "base/environment.h" |
14 #include "base/i18n/rtl.h" | 14 #include "base/i18n/rtl.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/scoped_native_library.h" | 17 #include "base/scoped_native_library.h" |
18 #include "base/string_number_conversions.h" | 18 #include "base/string_number_conversions.h" |
19 #include "base/utf_string_conversions.h" | 19 #include "base/utf_string_conversions.h" |
20 #include "base/win/windows_version.h" | 20 #include "base/win/windows_version.h" |
21 #include "base/win/wrapped_window_proc.h" | 21 #include "base/win/wrapped_window_proc.h" |
22 #include "chrome/browser/browser_util_win.h" | 22 #include "chrome/browser/browser_util_win.h" |
23 #include "chrome/browser/first_run/first_run.h" | 23 #include "chrome/browser/first_run/first_run.h" |
24 #include "chrome/browser/metrics/metrics_service.h" | 24 #include "chrome/browser/metrics/metrics_service.h" |
25 #include "chrome/browser/profiles/profile_info_cache.h" | |
26 #include "chrome/browser/profiles/profile_shortcut_manager_win.h" | |
25 #include "chrome/browser/ui/browser_list.h" | 27 #include "chrome/browser/ui/browser_list.h" |
26 #include "chrome/browser/ui/views/uninstall_view.h" | 28 #include "chrome/browser/ui/views/uninstall_view.h" |
27 #include "chrome/common/chrome_constants.h" | 29 #include "chrome/common/chrome_constants.h" |
28 #include "chrome/common/chrome_result_codes.h" | 30 #include "chrome/common/chrome_result_codes.h" |
29 #include "chrome/common/chrome_switches.h" | 31 #include "chrome/common/chrome_switches.h" |
30 #include "chrome/common/env_vars.h" | 32 #include "chrome/common/env_vars.h" |
31 #include "chrome/installer/util/browser_distribution.h" | 33 #include "chrome/installer/util/browser_distribution.h" |
32 #include "chrome/installer/util/helper.h" | 34 #include "chrome/installer/util/helper.h" |
33 #include "chrome/installer/util/install_util.h" | 35 #include "chrome/installer/util/install_util.h" |
34 #include "chrome/installer/util/shell_util.h" | 36 #include "chrome/installer/util/shell_util.h" |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 // The following actions are just best effort. | 138 // The following actions are just best effort. |
137 VLOG(1) << "Executing uninstall actions"; | 139 VLOG(1) << "Executing uninstall actions"; |
138 if (!FirstRun::RemoveSentinel()) | 140 if (!FirstRun::RemoveSentinel()) |
139 VLOG(1) << "Failed to delete sentinel file."; | 141 VLOG(1) << "Failed to delete sentinel file."; |
140 // We want to remove user level shortcuts and we only care about the ones | 142 // We want to remove user level shortcuts and we only care about the ones |
141 // created by us and not by the installer so |alternate| is false. | 143 // created by us and not by the installer so |alternate| is false. |
142 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 144 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
143 if (!ShellUtil::RemoveChromeDesktopShortcut(dist, ShellUtil::CURRENT_USER, | 145 if (!ShellUtil::RemoveChromeDesktopShortcut(dist, ShellUtil::CURRENT_USER, |
144 false)) | 146 false)) |
145 VLOG(1) << "Failed to delete desktop shortcut."; | 147 VLOG(1) << "Failed to delete desktop shortcut."; |
148 if (!ShellUtil::RemoveChromeDesktopShortcutsWithAppendedNames( | |
149 ProfileShortcutManagerWin::GenerateShortcutsFromProfiles( | |
150 ProfileInfoCache::GetProfileNames()))) | |
grt (UTC plus 2)
2011/11/18 16:02:15
nit: braces are required for these since the condi
| |
151 VLOG(1) << "Failed to delete desktop profiles shortcuts."; | |
146 if (!ShellUtil::RemoveChromeQuickLaunchShortcut(dist, | 152 if (!ShellUtil::RemoveChromeQuickLaunchShortcut(dist, |
147 ShellUtil::CURRENT_USER)) | 153 ShellUtil::CURRENT_USER)) |
148 VLOG(1) << "Failed to delete quick launch shortcut."; | 154 VLOG(1) << "Failed to delete quick launch shortcut."; |
149 } | 155 } |
150 return ret; | 156 return ret; |
151 } | 157 } |
152 | 158 |
153 // ChromeBrowserMainPartsWin --------------------------------------------------- | 159 // ChromeBrowserMainPartsWin --------------------------------------------------- |
154 | 160 |
155 ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin( | 161 ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin( |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 uninstall_cmd.AppendSwitch(installer::switches::kForceUninstall); | 300 uninstall_cmd.AppendSwitch(installer::switches::kForceUninstall); |
295 uninstall_cmd.AppendSwitch( | 301 uninstall_cmd.AppendSwitch( |
296 installer::switches::kDoNotRemoveSharedItems); | 302 installer::switches::kDoNotRemoveSharedItems); |
297 base::LaunchProcess(uninstall_cmd, base::LaunchOptions(), NULL); | 303 base::LaunchProcess(uninstall_cmd, base::LaunchOptions(), NULL); |
298 } | 304 } |
299 return true; | 305 return true; |
300 } | 306 } |
301 } | 307 } |
302 return false; | 308 return false; |
303 } | 309 } |
OLD | NEW |