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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 int result = chrome::ShowUninstallBrowserPrompt( | 117 int result = chrome::ShowUninstallBrowserPrompt( |
118 !chrome_launcher_support::IsAppLauncherPresent()); | 118 !chrome_launcher_support::IsAppLauncherPresent()); |
119 // Don't offer to delete the profile if the App Launcher is also installed. | 119 // Don't offer to delete the profile if the App Launcher is also installed. |
120 if (browser_util::IsBrowserAlreadyRunning()) { | 120 if (browser_util::IsBrowserAlreadyRunning()) { |
121 ShowCloseBrowserFirstMessageBox(); | 121 ShowCloseBrowserFirstMessageBox(); |
122 return chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE; | 122 return chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE; |
123 } | 123 } |
124 | 124 |
125 if (result != chrome::RESULT_CODE_UNINSTALL_USER_CANCEL) { | 125 if (result != chrome::RESULT_CODE_UNINSTALL_USER_CANCEL) { |
126 // The following actions are just best effort. | 126 // The following actions are just best effort. |
| 127 // TODO(gab): Look into removing this code which is now redundant with the |
| 128 // work done by setup.exe on uninstall. |
127 VLOG(1) << "Executing uninstall actions"; | 129 VLOG(1) << "Executing uninstall actions"; |
128 if (!first_run::RemoveSentinel()) | 130 if (!first_run::RemoveSentinel()) |
129 VLOG(1) << "Failed to delete sentinel file."; | 131 VLOG(1) << "Failed to delete sentinel file."; |
130 base::FilePath chrome_exe; | 132 base::FilePath chrome_exe; |
131 if (PathService::Get(base::FILE_EXE, &chrome_exe)) { | 133 if (PathService::Get(base::FILE_EXE, &chrome_exe)) { |
132 ShellUtil::ShortcutLocation user_shortcut_locations[] = { | 134 ShellUtil::ShortcutLocation user_shortcut_locations[] = { |
133 ShellUtil::SHORTCUT_LOCATION_DESKTOP, | 135 ShellUtil::SHORTCUT_LOCATION_DESKTOP, |
134 ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, | 136 ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, |
135 ShellUtil::SHORTCUT_LOCATION_START_MENU, | 137 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, |
| 138 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR, |
136 }; | 139 }; |
137 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 140 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
138 for (size_t i = 0; i < arraysize(user_shortcut_locations); ++i) { | 141 for (size_t i = 0; i < arraysize(user_shortcut_locations); ++i) { |
139 if (!ShellUtil::RemoveShortcuts(user_shortcut_locations[i], dist, | 142 if (!ShellUtil::RemoveShortcuts(user_shortcut_locations[i], dist, |
140 ShellUtil::CURRENT_USER, chrome_exe)) { | 143 ShellUtil::CURRENT_USER, chrome_exe)) { |
141 VLOG(1) << "Failed to delete shortcut at location " | 144 VLOG(1) << "Failed to delete shortcut at location " |
142 << user_shortcut_locations[i]; | 145 << user_shortcut_locations[i]; |
143 } | 146 } |
144 } | 147 } |
145 } else { | 148 } else { |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 if (resource_id) | 422 if (resource_id) |
420 return l10n_util::GetStringUTF16(resource_id); | 423 return l10n_util::GetStringUTF16(resource_id); |
421 return string16(); | 424 return string16(); |
422 } | 425 } |
423 | 426 |
424 // static | 427 // static |
425 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { | 428 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { |
426 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); | 429 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); |
427 installer::SetTranslationDelegate(&delegate); | 430 installer::SetTranslationDelegate(&delegate); |
428 } | 431 } |
OLD | NEW |