OLD | NEW |
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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 if (shortcut_operation == ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS || | 424 if (shortcut_operation == ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS || |
425 shortcut_operation == | 425 shortcut_operation == |
426 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL) { | 426 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL) { |
427 start_menu_properties.set_pin_to_taskbar(!do_not_create_taskbar_shortcut); | 427 start_menu_properties.set_pin_to_taskbar(!do_not_create_taskbar_shortcut); |
428 } | 428 } |
429 | 429 |
430 // The attempt below to update the stortcut will fail if it does not already | 430 // The attempt below to update the stortcut will fail if it does not already |
431 // exist at the expected location on disk. First check if it exists in the | 431 // exist at the expected location on disk. First check if it exists in the |
432 // previous location (under a subdirectory) and, if so, move it to the new | 432 // previous location (under a subdirectory) and, if so, move it to the new |
433 // location. | 433 // location. |
434 base::FilePath old_shortcut_path; | 434 // base::FilePath old_shortcut_path; |
435 ShellUtil::GetShortcutPath( | 435 // ShellUtil::GetShortcutPath( |
| 436 // ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, dist, |
| 437 // shortcut_level, &old_shortcut_path); |
| 438 // if (base::PathExists(old_shortcut_path)) { |
| 439 // ShellUtil::MoveExistingShortcut( |
| 440 // ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, |
| 441 // ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT, |
| 442 // dist, start_menu_properties); |
| 443 // } |
| 444 |
| 445 // ExecuteAndLogShortcutOperation( |
| 446 // ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT, dist, |
| 447 // start_menu_properties, shortcut_operation); |
| 448 |
| 449 // TODO(bcwhite): Reactivate the code above and remove this when we figure out |
| 450 // the cause of http://crbug.com/548964 and http://crbug.com/548965. |
| 451 ExecuteAndLogShortcutOperation( |
436 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, dist, | 452 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, dist, |
437 shortcut_level, &old_shortcut_path); | |
438 if (base::PathExists(old_shortcut_path)) { | |
439 ShellUtil::MoveExistingShortcut( | |
440 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, | |
441 ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT, | |
442 dist, start_menu_properties); | |
443 } | |
444 | |
445 ExecuteAndLogShortcutOperation( | |
446 ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT, dist, | |
447 start_menu_properties, shortcut_operation); | 453 start_menu_properties, shortcut_operation); |
448 } | 454 } |
449 | 455 |
450 void RegisterChromeOnMachine(const installer::InstallerState& installer_state, | 456 void RegisterChromeOnMachine(const installer::InstallerState& installer_state, |
451 const installer::Product& product, | 457 const installer::Product& product, |
452 bool make_chrome_default) { | 458 bool make_chrome_default) { |
453 DCHECK(product.is_chrome()); | 459 DCHECK(product.is_chrome()); |
454 | 460 |
455 // Try to add Chrome to Media Player shim inclusion list. We don't do any | 461 // Try to add Chrome to Media Player shim inclusion list. We don't do any |
456 // error checking here because this operation will fail if user doesn't | 462 // error checking here because this operation will fail if user doesn't |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 // Read master_preferences copied beside chrome.exe at install. | 697 // Read master_preferences copied beside chrome.exe at install. |
692 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); | 698 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); |
693 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); | 699 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); |
694 CreateOrUpdateShortcuts( | 700 CreateOrUpdateShortcuts( |
695 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); | 701 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); |
696 | 702 |
697 UpdateDefaultBrowserBeaconForPath(chrome_exe); | 703 UpdateDefaultBrowserBeaconForPath(chrome_exe); |
698 } | 704 } |
699 | 705 |
700 } // namespace installer | 706 } // namespace installer |
OLD | NEW |