Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Side by Side Diff: chrome/browser/chrome_browser_main_win.cc

Issue 11693010: Windows: Remove desktop profile shortcuts (and any others pointing to the exe) on uninstall. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_shortcut_manager_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 if (browser_util::IsBrowserAlreadyRunning()) { 131 if (browser_util::IsBrowserAlreadyRunning()) {
132 ShowCloseBrowserFirstMessageBox(); 132 ShowCloseBrowserFirstMessageBox();
133 return chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE; 133 return chrome::RESULT_CODE_UNINSTALL_CHROME_ALIVE;
134 } 134 }
135 135
136 if (result != chrome::RESULT_CODE_UNINSTALL_USER_CANCEL) { 136 if (result != chrome::RESULT_CODE_UNINSTALL_USER_CANCEL) {
137 // The following actions are just best effort. 137 // The following actions are just best effort.
138 VLOG(1) << "Executing uninstall actions"; 138 VLOG(1) << "Executing uninstall actions";
139 if (!first_run::RemoveSentinel()) 139 if (!first_run::RemoveSentinel())
140 VLOG(1) << "Failed to delete sentinel file."; 140 VLOG(1) << "Failed to delete sentinel file.";
141 // We want to remove user level shortcuts and we only care about the ones
142 // created by us and not by the installer so |alternate| is false.
143 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
144 FilePath chrome_exe; 141 FilePath chrome_exe;
145 if (PathService::Get(base::FILE_EXE, &chrome_exe)) { 142 if (PathService::Get(base::FILE_EXE, &chrome_exe)) {
146 ShellUtil::ShortcutLocation user_shortcut_locations[] = { 143 ShellUtil::ShortcutLocation user_shortcut_locations[] = {
147 ShellUtil::SHORTCUT_LOCATION_DESKTOP, 144 ShellUtil::SHORTCUT_LOCATION_DESKTOP,
148 ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, 145 ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH,
149 ShellUtil::SHORTCUT_LOCATION_START_MENU, 146 ShellUtil::SHORTCUT_LOCATION_START_MENU,
150 }; 147 };
148 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
151 for (size_t i = 0; i < arraysize(user_shortcut_locations); ++i) { 149 for (size_t i = 0; i < arraysize(user_shortcut_locations); ++i) {
152 if (!ShellUtil::RemoveShortcut( 150 if (!ShellUtil::RemoveShortcut(user_shortcut_locations[i], dist,
153 user_shortcut_locations[i], dist, chrome_exe.value(), 151 chrome_exe, ShellUtil::CURRENT_USER,
154 ShellUtil::CURRENT_USER, NULL)) { 152 NULL)) {
155 VLOG(1) << "Failed to delete shortcut at location " 153 VLOG(1) << "Failed to delete shortcut at location "
156 << user_shortcut_locations[i]; 154 << user_shortcut_locations[i];
157 } 155 }
158 } 156 }
159 // TODO(rlp): Cleanup profiles shortcuts.
160 } else { 157 } else {
161 NOTREACHED(); 158 NOTREACHED();
162 } 159 }
163 } 160 }
164 return result; 161 return result;
165 } 162 }
166 163
167 // ChromeBrowserMainPartsWin --------------------------------------------------- 164 // ChromeBrowserMainPartsWin ---------------------------------------------------
168 165
169 ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin( 166 ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin(
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
412 if (resource_id) 409 if (resource_id)
413 return l10n_util::GetStringUTF16(resource_id); 410 return l10n_util::GetStringUTF16(resource_id);
414 return string16(); 411 return string16();
415 } 412 }
416 413
417 // static 414 // static
418 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { 415 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() {
419 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); 416 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ());
420 installer::SetTranslationDelegate(&delegate); 417 installer::SetTranslationDelegate(&delegate);
421 } 418 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_shortcut_manager_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698