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 #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> |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 if (browser_util::IsBrowserAlreadyRunning()) { | 128 if (browser_util::IsBrowserAlreadyRunning()) { |
129 ShowCloseBrowserFirstMessageBox(); | 129 ShowCloseBrowserFirstMessageBox(); |
130 return chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE; | 130 return chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE; |
131 } | 131 } |
132 | 132 |
133 if (result != chrome::RESULT_CODE_UNINSTALL_USER_CANCEL) { | 133 if (result != chrome::RESULT_CODE_UNINSTALL_USER_CANCEL) { |
134 // The following actions are just best effort. | 134 // The following actions are just best effort. |
135 VLOG(1) << "Executing uninstall actions"; | 135 VLOG(1) << "Executing uninstall actions"; |
136 if (!first_run::RemoveSentinel()) | 136 if (!first_run::RemoveSentinel()) |
137 VLOG(1) << "Failed to delete sentinel file."; | 137 VLOG(1) << "Failed to delete sentinel file."; |
138 // We want to remove user level shortcuts and we only care about the ones | |
139 // created by us and not by the installer so |alternate| is false. | |
140 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | |
141 FilePath chrome_exe; | 138 FilePath chrome_exe; |
142 if (PathService::Get(base::FILE_EXE, &chrome_exe)) { | 139 if (PathService::Get(base::FILE_EXE, &chrome_exe)) { |
143 ShellUtil::ShortcutLocation user_shortcut_locations[] = { | 140 ShellUtil::ShortcutLocation user_shortcut_locations[] = { |
144 ShellUtil::SHORTCUT_LOCATION_DESKTOP, | 141 ShellUtil::SHORTCUT_LOCATION_DESKTOP, |
145 ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, | 142 ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, |
146 ShellUtil::SHORTCUT_LOCATION_START_MENU, | 143 ShellUtil::SHORTCUT_LOCATION_START_MENU, |
147 }; | 144 }; |
| 145 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
148 for (size_t i = 0; i < arraysize(user_shortcut_locations); ++i) { | 146 for (size_t i = 0; i < arraysize(user_shortcut_locations); ++i) { |
149 if (!ShellUtil::RemoveShortcut( | 147 if (!ShellUtil::RemoveShortcut(user_shortcut_locations[i], dist, |
150 user_shortcut_locations[i], dist, chrome_exe.value(), | 148 chrome_exe, ShellUtil::CURRENT_USER, |
151 ShellUtil::CURRENT_USER, NULL)) { | 149 NULL)) { |
152 VLOG(1) << "Failed to delete shortcut at location " | 150 VLOG(1) << "Failed to delete shortcut at location " |
153 << user_shortcut_locations[i]; | 151 << user_shortcut_locations[i]; |
154 } | 152 } |
155 } | 153 } |
156 // TODO(rlp): Cleanup profiles shortcuts. | |
157 } else { | 154 } else { |
158 NOTREACHED(); | 155 NOTREACHED(); |
159 } | 156 } |
160 } | 157 } |
161 return result; | 158 return result; |
162 } | 159 } |
163 | 160 |
164 // ChromeBrowserMainPartsWin --------------------------------------------------- | 161 // ChromeBrowserMainPartsWin --------------------------------------------------- |
165 | 162 |
166 ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin( | 163 ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin( |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
389 if (resource_id) | 386 if (resource_id) |
390 return l10n_util::GetStringUTF16(resource_id); | 387 return l10n_util::GetStringUTF16(resource_id); |
391 return string16(); | 388 return string16(); |
392 } | 389 } |
393 | 390 |
394 // static | 391 // static |
395 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 392 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
396 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 393 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
397 installer::SetTranslationDelegate(&delegate); | 394 installer::SetTranslationDelegate(&delegate); |
398 } | 395 } |
OLD | NEW |