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

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

Issue 10836247: Refactor ShellUtil shortcut code -- single multi-purpose methods as opposed to many slighlty diffe… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix some comments Created 8 years, 4 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
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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 } 121 }
122 122
123 if (result != chrome::RESULT_CODE_UNINSTALL_USER_CANCEL) { 123 if (result != chrome::RESULT_CODE_UNINSTALL_USER_CANCEL) {
124 // The following actions are just best effort. 124 // The following actions are just best effort.
125 VLOG(1) << "Executing uninstall actions"; 125 VLOG(1) << "Executing uninstall actions";
126 if (!first_run::RemoveSentinel()) 126 if (!first_run::RemoveSentinel())
127 VLOG(1) << "Failed to delete sentinel file."; 127 VLOG(1) << "Failed to delete sentinel file.";
128 // We want to remove user level shortcuts and we only care about the ones 128 // We want to remove user level shortcuts and we only care about the ones
129 // created by us and not by the installer so |alternate| is false. 129 // created by us and not by the installer so |alternate| is false.
130 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); 130 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
131 if (!ShellUtil::RemoveChromeDesktopShortcut( 131 if (!ShellUtil::RemoveChromeShortcut(ShellUtil::SHORTCUT_DESKTOP, dist,
132 dist, ShellUtil::CURRENT_USER, ShellUtil::SHORTCUT_NO_OPTIONS)) { 132 ShellUtil::SHORTCUT_NO_OPTIONS)) {
133 VLOG(1) << "Failed to delete desktop shortcut."; 133 VLOG(1) << "Failed to delete desktop shortcut.";
134 } 134 }
135 // TODO(hallielaine): Cleanup profiles shortcuts. 135 // TODO(hallielaine): Cleanup profiles shortcuts.
136 if (!ShellUtil::RemoveChromeQuickLaunchShortcut(dist, 136 if (!ShellUtil::RemoveChromeShortcut(ShellUtil::SHORTCUT_QUICK_LAUNCH, dist,
137 ShellUtil::CURRENT_USER)) { 137 ShellUtil::SHORTCUT_NO_OPTIONS)) {
138 VLOG(1) << "Failed to delete quick launch shortcut."; 138 VLOG(1) << "Failed to delete quick launch shortcut.";
139 } 139 }
140 } 140 }
141 return result; 141 return result;
142 } 142 }
143 143
144 // ChromeBrowserMainPartsWin --------------------------------------------------- 144 // ChromeBrowserMainPartsWin ---------------------------------------------------
145 145
146 ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin( 146 ChromeBrowserMainPartsWin::ChromeBrowserMainPartsWin(
147 const content::MainFunctionParams& parameters) 147 const content::MainFunctionParams& parameters)
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 if (resource_id) 340 if (resource_id)
341 return l10n_util::GetStringUTF16(resource_id); 341 return l10n_util::GetStringUTF16(resource_id);
342 return string16(); 342 return string16();
343 } 343 }
344 344
345 // static 345 // static
346 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { 346 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() {
347 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); 347 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ());
348 installer::SetTranslationDelegate(&delegate); 348 installer::SetTranslationDelegate(&delegate);
349 } 349 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/first_run/first_run_win.cc » ('j') | chrome/installer/setup/install.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698