| 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 // This file declares util functions for setup project. It also declares a | 5 // This file declares util functions for setup project. It also declares a |
| 6 // few functions that the Chrome component updater uses for patching binary | 6 // few functions that the Chrome component updater uses for patching binary |
| 7 // deltas. | 7 // deltas. |
| 8 | 8 |
| 9 #ifndef CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 9 #ifndef CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| 10 #define CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 10 #define CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| 11 | 11 |
| 12 #include <windows.h> | 12 #include <windows.h> |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
| 16 #include "base/win/scoped_handle.h" | 16 #include "base/win/scoped_handle.h" |
| 17 #include "chrome/installer/util/browser_distribution.h" | 17 #include "chrome/installer/util/browser_distribution.h" |
| 18 #include "chrome/installer/util/util_constants.h" | 18 #include "chrome/installer/util/util_constants.h" |
| 19 | 19 |
| 20 namespace base { |
| 20 class CommandLine; | 21 class CommandLine; |
| 21 | |
| 22 namespace base { | |
| 23 class FilePath; | 22 class FilePath; |
| 24 class Version; | 23 class Version; |
| 25 } | 24 } |
| 26 | 25 |
| 27 namespace installer { | 26 namespace installer { |
| 28 | 27 |
| 29 class InstallationState; | 28 class InstallationState; |
| 30 class InstallerState; | 29 class InstallerState; |
| 31 class ProductState; | 30 class ProductState; |
| 32 | 31 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 bool system_install, | 71 bool system_install, |
| 73 const base::Version& installer_version, | 72 const base::Version& installer_version, |
| 74 base::FilePath* setup_exe); | 73 base::FilePath* setup_exe); |
| 75 | 74 |
| 76 // Invokes the pre-existing |setup_exe| to handle the current operation (as | 75 // Invokes the pre-existing |setup_exe| to handle the current operation (as |
| 77 // dictated by |command_line|). An installerdata file, if specified, is first | 76 // dictated by |command_line|). An installerdata file, if specified, is first |
| 78 // unconditionally copied into place so that it will be in effect in case the | 77 // unconditionally copied into place so that it will be in effect in case the |
| 79 // invoked |setup_exe| runs the newly installed product prior to exiting. | 78 // invoked |setup_exe| runs the newly installed product prior to exiting. |
| 80 // Returns true if |setup_exe| was launched, false otherwise. | 79 // Returns true if |setup_exe| was launched, false otherwise. |
| 81 bool DeferToExistingInstall(const base::FilePath& setup_exe, | 80 bool DeferToExistingInstall(const base::FilePath& setup_exe, |
| 82 const CommandLine& command_line, | 81 const base::CommandLine& command_line, |
| 83 const InstallerState& installer_state, | 82 const InstallerState& installer_state, |
| 84 const base::FilePath& temp_path, | 83 const base::FilePath& temp_path, |
| 85 InstallStatus* install_status); | 84 InstallStatus* install_status); |
| 86 | 85 |
| 87 // Returns true if the product |type| will be installed after the current | 86 // Returns true if the product |type| will be installed after the current |
| 88 // setup.exe instance have carried out installation / uninstallation, at | 87 // setup.exe instance have carried out installation / uninstallation, at |
| 89 // the level specified by |installer_state|. | 88 // the level specified by |installer_state|. |
| 90 // This function only returns meaningful results for install and update | 89 // This function only returns meaningful results for install and update |
| 91 // operations if called after CheckPreInstallConditions (see setup_main.cc). | 90 // operations if called after CheckPreInstallConditions (see setup_main.cc). |
| 92 bool WillProductBePresentAfterSetup( | 91 bool WillProductBePresentAfterSetup( |
| (...skipping 11 matching lines...) Expand all Loading... |
| 104 // value and adjusting the ap values of all multi-install products. | 103 // value and adjusting the ap values of all multi-install products. |
| 105 void MigrateGoogleUpdateStateMultiToSingle( | 104 void MigrateGoogleUpdateStateMultiToSingle( |
| 106 bool system_level, | 105 bool system_level, |
| 107 BrowserDistribution::Type to_migrate, | 106 BrowserDistribution::Type to_migrate, |
| 108 const installer::InstallationState& machine_state); | 107 const installer::InstallationState& machine_state); |
| 109 | 108 |
| 110 // Returns true if |install_status| represents a successful uninstall code. | 109 // Returns true if |install_status| represents a successful uninstall code. |
| 111 bool IsUninstallSuccess(InstallStatus install_status); | 110 bool IsUninstallSuccess(InstallStatus install_status); |
| 112 | 111 |
| 113 // Returns true if |cmd_line| contains unsupported (legacy) switches. | 112 // Returns true if |cmd_line| contains unsupported (legacy) switches. |
| 114 bool ContainsUnsupportedSwitch(const CommandLine& cmd_line); | 113 bool ContainsUnsupportedSwitch(const base::CommandLine& cmd_line); |
| 115 | 114 |
| 116 // Returns true if the processor is supported by chrome. | 115 // Returns true if the processor is supported by chrome. |
| 117 bool IsProcessorSupported(); | 116 bool IsProcessorSupported(); |
| 118 | 117 |
| 119 // This class will enable the privilege defined by |privilege_name| on the | 118 // This class will enable the privilege defined by |privilege_name| on the |
| 120 // current process' token. The privilege will be disabled upon the | 119 // current process' token. The privilege will be disabled upon the |
| 121 // ScopedTokenPrivilege's destruction (unless it was already enabled when the | 120 // ScopedTokenPrivilege's destruction (unless it was already enabled when the |
| 122 // ScopedTokenPrivilege object was constructed). | 121 // ScopedTokenPrivilege object was constructed). |
| 123 // Some privileges might require admin rights to be enabled (check is_enabled() | 122 // Some privileges might require admin rights to be enabled (check is_enabled() |
| 124 // to know whether |privilege_name| was successfully enabled). | 123 // to know whether |privilege_name| was successfully enabled). |
| (...skipping 16 matching lines...) Expand all Loading... |
| 141 // The previous state of the privilege this object is responsible for. As set | 140 // The previous state of the privilege this object is responsible for. As set |
| 142 // by AdjustTokenPrivileges() upon construction. | 141 // by AdjustTokenPrivileges() upon construction. |
| 143 TOKEN_PRIVILEGES previous_privileges_; | 142 TOKEN_PRIVILEGES previous_privileges_; |
| 144 | 143 |
| 145 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); | 144 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); |
| 146 }; | 145 }; |
| 147 | 146 |
| 148 } // namespace installer | 147 } // namespace installer |
| 149 | 148 |
| 150 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 149 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| OLD | NEW |