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

Unified Diff: chrome/browser/first_run/first_run_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: adress comments about shell_util interface Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/first_run/first_run_win.cc
diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc
index fbd92bc10deb3388779a0d1f4a4d685a8d06236d..fda4e3cdeac5e1774420cf0aa8cf926a9e68e760 100644
--- a/chrome/browser/first_run/first_run_win.cc
+++ b/chrome/browser/first_run/first_run_win.cc
@@ -111,16 +111,11 @@ bool CreateChromeDesktopShortcut() {
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
if (!dist || !dist->CanCreateDesktopShortcuts())
return false;
- return ShellUtil::CreateChromeDesktopShortcut(
- dist,
- chrome_exe.value(),
- dist->GetAppDescription(),
- L"",
- L"",
- chrome_exe.value(),
- dist->GetIconIndex(),
- ShellUtil::CURRENT_USER,
- ShellUtil::SHORTCUT_CREATE_ALWAYS);
+ ShellUtil::ChromeShortcutProperties properties(ShellUtil::CURRENT_USER);
robertshield 2012/10/04 00:25:23 nit: vague preference for shortcut_properties over
gab 2012/10/04 04:10:32 Sure, although this makes the definition take 2 li
+ properties.set_chrome_exe(chrome_exe);
+ return ShellUtil::CreateOrUpdateChromeShortcut(
+ ShellUtil::SHORTCUT_DESKTOP, dist, properties,
+ ShellUtil::SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL);
}
// Creates the quick launch shortcut to chrome for the current user. Returns
@@ -130,11 +125,11 @@ bool CreateChromeQuickLaunchShortcut() {
if (!PathService::Get(base::FILE_EXE, &chrome_exe))
return false;
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
- return ShellUtil::CreateChromeQuickLaunchShortcut(
- dist,
- chrome_exe.value(),
- ShellUtil::CURRENT_USER, // create only for current user.
- ShellUtil::SHORTCUT_CREATE_ALWAYS);
+ ShellUtil::ChromeShortcutProperties properties(ShellUtil::CURRENT_USER);
+ properties.set_chrome_exe(chrome_exe);
+ return ShellUtil::CreateOrUpdateChromeShortcut(
+ ShellUtil::SHORTCUT_QUICK_LAUNCH, dist, properties,
+ ShellUtil::SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL);
}
void PlatformSetup(Profile* profile) {

Powered by Google App Engine
This is Rietveld 408576698