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

Side by Side Diff: chrome/installer/setup/install.cc

Issue 14287008: Refactoring installer shortcut deletion; adding dedicated shortcut update feature. (Closed) Base URL: http://chromium.googlesource.com/chromium/src.git@master
Patch Set: Reverting ShellUtil unittest changes; bit more fixing. Created 7 years, 7 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
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/installer/setup/install.h" 5 #include "chrome/installer/setup/install.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shlobj.h> 8 #include <shlobj.h>
9 #include <time.h> 9 #include <time.h>
10 10
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 ShellUtil::ShellChange shortcut_level = installer_state.system_install() ? 253 ShellUtil::ShellChange shortcut_level = installer_state.system_install() ?
254 ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER; 254 ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER;
255 base::FilePath uninstall_shortcut_path; 255 base::FilePath uninstall_shortcut_path;
256 ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_START_MENU, dist, 256 ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_START_MENU, dist,
257 shortcut_level, &uninstall_shortcut_path); 257 shortcut_level, &uninstall_shortcut_path);
258 uninstall_shortcut_path = uninstall_shortcut_path.Append( 258 uninstall_shortcut_path = uninstall_shortcut_path.Append(
259 dist->GetUninstallLinkName() + installer::kLnkExt); 259 dist->GetUninstallLinkName() + installer::kLnkExt);
260 file_util::Delete(uninstall_shortcut_path, false); 260 file_util::Delete(uninstall_shortcut_path, false);
261 261
262 if (installer_state.system_install()) { 262 if (installer_state.system_install()) {
263 ShellUtil::RemoveShortcut( 263 ShellUtil::RemoveShortcuts(
264 ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist, chrome_exe, 264 ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist,
265 ShellUtil::SYSTEM_LEVEL, NULL); 265 ShellUtil::SYSTEM_LEVEL, chrome_exe);
266 } 266 }
267 } 267 }
268 268
269 // Returns the appropriate shortcut operations for App Launcher, 269 // Returns the appropriate shortcut operations for App Launcher,
270 // based on state of installation and master_preferences. 270 // based on state of installation and master_preferences.
271 installer::InstallShortcutOperation GetAppLauncherShortcutOperation( 271 installer::InstallShortcutOperation GetAppLauncherShortcutOperation(
272 const InstallationState& original_state, 272 const InstallationState& original_state,
273 const InstallerState& installer_state) { 273 const InstallerState& installer_state) {
274 const installer::ProductState* original_app_host_state = 274 const installer::ProductState* original_app_host_state =
275 original_state.GetProductState(installer_state.system_install(), 275 original_state.GetProductState(installer_state.system_install(),
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 if (app_host_path.empty()) 689 if (app_host_path.empty())
690 return false; 690 return false;
691 691
692 CommandLine cmd(app_host_path); 692 CommandLine cmd(app_host_path);
693 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); 693 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code);
694 VLOG(1) << "App install command: " << cmd.GetCommandLineString(); 694 VLOG(1) << "App install command: " << cmd.GetCommandLineString();
695 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); 695 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL);
696 } 696 }
697 697
698 } // namespace installer 698 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698