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

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

Issue 12316097: Added master_preferences to control shortcuts on windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: addressed comments Created 7 years, 9 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
« no previous file with comments | « no previous file | chrome/installer/util/master_preferences_constants.h » ('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/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 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
353 } 353 }
354 } 354 }
355 } 355 }
356 356
357 void CreateOrUpdateShortcuts( 357 void CreateOrUpdateShortcuts(
358 const base::FilePath& target, 358 const base::FilePath& target,
359 const Product& product, 359 const Product& product,
360 const MasterPreferences& prefs, 360 const MasterPreferences& prefs,
361 InstallShortcutLevel install_level, 361 InstallShortcutLevel install_level,
362 InstallShortcutOperation install_operation) { 362 InstallShortcutOperation install_operation) {
363 bool do_not_create_any_shortcuts = false;
364 prefs.GetBool(master_preferences::kDoNotCreateAnyShortcuts,
365 &do_not_create_any_shortcuts);
366 if (do_not_create_any_shortcuts)
367 return;
368
363 // Extract shortcut preferences from |prefs|. 369 // Extract shortcut preferences from |prefs|.
364 bool do_not_create_desktop_shortcut = false; 370 bool do_not_create_desktop_shortcut = false;
365 bool do_not_create_quick_launch_shortcut = false; 371 bool do_not_create_quick_launch_shortcut = false;
372 bool do_not_create_taskbar_shortcut = false;
366 bool alternate_desktop_shortcut = false; 373 bool alternate_desktop_shortcut = false;
367 prefs.GetBool(master_preferences::kDoNotCreateDesktopShortcut, 374 prefs.GetBool(master_preferences::kDoNotCreateDesktopShortcut,
368 &do_not_create_desktop_shortcut); 375 &do_not_create_desktop_shortcut);
369 prefs.GetBool(master_preferences::kDoNotCreateQuickLaunchShortcut, 376 prefs.GetBool(master_preferences::kDoNotCreateQuickLaunchShortcut,
370 &do_not_create_quick_launch_shortcut); 377 &do_not_create_quick_launch_shortcut);
378 prefs.GetBool(master_preferences::kDoNotCreateTaskbarShortcut,
379 &do_not_create_taskbar_shortcut);
371 prefs.GetBool(master_preferences::kAltShortcutText, 380 prefs.GetBool(master_preferences::kAltShortcutText,
372 &alternate_desktop_shortcut); 381 &alternate_desktop_shortcut);
373 382
374 BrowserDistribution* dist = product.distribution(); 383 BrowserDistribution* dist = product.distribution();
375 384
376 // The default operation on update is to overwrite shortcuts with the 385 // The default operation on update is to overwrite shortcuts with the
377 // currently desired properties, but do so only for shortcuts that still 386 // currently desired properties, but do so only for shortcuts that still
378 // exist. 387 // exist.
379 ShellUtil::ShortcutOperation shortcut_operation; 388 ShellUtil::ShortcutOperation shortcut_operation;
380 switch (install_operation) { 389 switch (install_operation) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 } 440 }
432 441
433 ShellUtil::ShortcutProperties start_menu_properties(base_properties); 442 ShellUtil::ShortcutProperties start_menu_properties(base_properties);
434 // IMPORTANT: Only the default (no arguments and default browserappid) browser 443 // IMPORTANT: Only the default (no arguments and default browserappid) browser
435 // shortcut in the Start menu (Start screen on Win8+) should be made dual 444 // shortcut in the Start menu (Start screen on Win8+) should be made dual
436 // mode. 445 // mode.
437 start_menu_properties.set_dual_mode(true); 446 start_menu_properties.set_dual_mode(true);
438 if (shortcut_operation == ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS || 447 if (shortcut_operation == ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS ||
439 shortcut_operation == 448 shortcut_operation ==
440 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL) { 449 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL) {
441 start_menu_properties.set_pin_to_taskbar(true); 450 if (!do_not_create_taskbar_shortcut)
gab 2013/03/06 23:18:16 Please nest this condition in the if above it, i.e
Joao da Silva 2013/03/07 07:13:43 Done.
451 start_menu_properties.set_pin_to_taskbar(true);
442 } 452 }
443 ExecuteAndLogShortcutOperation(ShellUtil::SHORTCUT_LOCATION_START_MENU, 453 ExecuteAndLogShortcutOperation(ShellUtil::SHORTCUT_LOCATION_START_MENU,
444 dist, start_menu_properties, 454 dist, start_menu_properties,
445 shortcut_operation); 455 shortcut_operation);
446 } 456 }
447 457
448 void RegisterChromeOnMachine(const InstallerState& installer_state, 458 void RegisterChromeOnMachine(const InstallerState& installer_state,
449 const Product& product, 459 const Product& product,
450 bool make_chrome_default) { 460 bool make_chrome_default) {
451 DCHECK(product.is_chrome()); 461 DCHECK(product.is_chrome());
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 if (app_host_path.empty()) 689 if (app_host_path.empty())
680 return false; 690 return false;
681 691
682 CommandLine cmd(app_host_path); 692 CommandLine cmd(app_host_path);
683 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); 693 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code);
684 VLOG(1) << "App install command: " << cmd.GetCommandLineString(); 694 VLOG(1) << "App install command: " << cmd.GetCommandLineString();
685 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); 695 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL);
686 } 696 }
687 697
688 } // namespace installer 698 } // namespace installer
OLDNEW
« no previous file with comments | « no previous file | chrome/installer/util/master_preferences_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698