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 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 ExecuteAndLogShortcutOperation( | 436 ExecuteAndLogShortcutOperation( |
437 ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT, dist, | 437 ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT, dist, |
438 start_menu_properties, shortcut_operation); | 438 start_menu_properties, shortcut_operation); |
439 } | 439 } |
440 | 440 |
441 void RegisterChromeOnMachine(const installer::InstallerState& installer_state, | 441 void RegisterChromeOnMachine(const installer::InstallerState& installer_state, |
442 const installer::Product& product, | 442 const installer::Product& product, |
443 bool make_chrome_default) { | 443 bool make_chrome_default) { |
444 DCHECK(product.is_chrome()); | 444 DCHECK(product.is_chrome()); |
445 | 445 |
| 446 const base::FilePath chrome_exe( |
| 447 installer_state.target_path().Append(installer::kChromeExe)); |
| 448 |
446 // Try to add Chrome to Media Player shim inclusion list. We don't do any | 449 // Try to add Chrome to Media Player shim inclusion list. We don't do any |
447 // error checking here because this operation will fail if user doesn't | 450 // error checking here because this operation will fail if user doesn't |
448 // have admin rights and we want to ignore the error. | 451 // have admin rights and we want to ignore the error. |
449 AddChromeToMediaPlayerList(); | 452 AddChromeToMediaPlayerList(); |
450 | 453 |
| 454 // Try to register the event log provider for Chrome, but only if it is a |
| 455 // system profile because this step admin privileges. |
| 456 if (installer_state.system_install()) |
| 457 RegisterEventLogProvider(chrome_exe); |
| 458 |
451 // Make Chrome the default browser if desired when possible. Otherwise, only | 459 // Make Chrome the default browser if desired when possible. Otherwise, only |
452 // register it with Windows. | 460 // register it with Windows. |
453 BrowserDistribution* dist = product.distribution(); | 461 BrowserDistribution* dist = product.distribution(); |
454 const base::FilePath chrome_exe( | |
455 installer_state.target_path().Append(installer::kChromeExe)); | |
456 VLOG(1) << "Registering Chrome as browser: " << chrome_exe.value(); | 462 VLOG(1) << "Registering Chrome as browser: " << chrome_exe.value(); |
457 if (make_chrome_default && ShellUtil::CanMakeChromeDefaultUnattended()) { | 463 if (make_chrome_default && ShellUtil::CanMakeChromeDefaultUnattended()) { |
458 int level = ShellUtil::CURRENT_USER; | 464 int level = ShellUtil::CURRENT_USER; |
459 if (installer_state.system_install()) | 465 if (installer_state.system_install()) |
460 level = level | ShellUtil::SYSTEM_LEVEL; | 466 level = level | ShellUtil::SYSTEM_LEVEL; |
461 ShellUtil::MakeChromeDefault(dist, level, chrome_exe, true); | 467 ShellUtil::MakeChromeDefault(dist, level, chrome_exe, true); |
462 } else { | 468 } else { |
463 ShellUtil::RegisterChromeBrowser(dist, chrome_exe, base::string16(), false); | 469 ShellUtil::RegisterChromeBrowser(dist, chrome_exe, base::string16(), false); |
464 } | 470 } |
465 } | 471 } |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 // Read master_preferences copied beside chrome.exe at install. | 723 // Read master_preferences copied beside chrome.exe at install. |
718 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); | 724 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); |
719 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); | 725 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); |
720 CreateOrUpdateShortcuts( | 726 CreateOrUpdateShortcuts( |
721 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); | 727 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); |
722 | 728 |
723 UpdateDefaultBrowserBeaconForPath(chrome_exe); | 729 UpdateDefaultBrowserBeaconForPath(chrome_exe); |
724 } | 730 } |
725 | 731 |
726 } // namespace installer | 732 } // namespace installer |
OLD | NEW |