| 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_ |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 // from multi-install to single-install. This includes copying the usagestats | 103 // from multi-install to single-install. This includes copying the usagestats |
| 104 // value and adjusting the ap values of all multi-install products. | 104 // value and adjusting the ap values of all multi-install products. |
| 105 void MigrateGoogleUpdateStateMultiToSingle( | 105 void MigrateGoogleUpdateStateMultiToSingle( |
| 106 bool system_level, | 106 bool system_level, |
| 107 BrowserDistribution::Type to_migrate, | 107 BrowserDistribution::Type to_migrate, |
| 108 const installer::InstallationState& machine_state); | 108 const installer::InstallationState& machine_state); |
| 109 | 109 |
| 110 // Returns true if |install_status| represents a successful uninstall code. | 110 // Returns true if |install_status| represents a successful uninstall code. |
| 111 bool IsUninstallSuccess(InstallStatus install_status); | 111 bool IsUninstallSuccess(InstallStatus install_status); |
| 112 | 112 |
| 113 // Returns true if |cmd_line| contains unsupported (legacy) switches. | |
| 114 bool ContainsUnsupportedSwitch(const CommandLine& cmd_line); | |
| 115 | |
| 116 // This class will enable the privilege defined by |privilege_name| on the | 113 // This class will enable the privilege defined by |privilege_name| on the |
| 117 // current process' token. The privilege will be disabled upon the | 114 // current process' token. The privilege will be disabled upon the |
| 118 // ScopedTokenPrivilege's destruction (unless it was already enabled when the | 115 // ScopedTokenPrivilege's destruction (unless it was already enabled when the |
| 119 // ScopedTokenPrivilege object was constructed). | 116 // ScopedTokenPrivilege object was constructed). |
| 120 // Some privileges might require admin rights to be enabled (check is_enabled() | 117 // Some privileges might require admin rights to be enabled (check is_enabled() |
| 121 // to know whether |privilege_name| was successfully enabled). | 118 // to know whether |privilege_name| was successfully enabled). |
| 122 class ScopedTokenPrivilege { | 119 class ScopedTokenPrivilege { |
| 123 public: | 120 public: |
| 124 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); | 121 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); |
| 125 ~ScopedTokenPrivilege(); | 122 ~ScopedTokenPrivilege(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 138 // The previous state of the privilege this object is responsible for. As set | 135 // The previous state of the privilege this object is responsible for. As set |
| 139 // by AdjustTokenPrivileges() upon construction. | 136 // by AdjustTokenPrivileges() upon construction. |
| 140 TOKEN_PRIVILEGES previous_privileges_; | 137 TOKEN_PRIVILEGES previous_privileges_; |
| 141 | 138 |
| 142 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); | 139 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); |
| 143 }; | 140 }; |
| 144 | 141 |
| 145 } // namespace installer | 142 } // namespace installer |
| 146 | 143 |
| 147 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 144 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| OLD | NEW |