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 |
113 // This class will enable the privilege defined by |privilege_name| on the | 116 // This class will enable the privilege defined by |privilege_name| on the |
114 // current process' token. The privilege will be disabled upon the | 117 // current process' token. The privilege will be disabled upon the |
115 // ScopedTokenPrivilege's destruction (unless it was already enabled when the | 118 // ScopedTokenPrivilege's destruction (unless it was already enabled when the |
116 // ScopedTokenPrivilege object was constructed). | 119 // ScopedTokenPrivilege object was constructed). |
117 // Some privileges might require admin rights to be enabled (check is_enabled() | 120 // Some privileges might require admin rights to be enabled (check is_enabled() |
118 // to know whether |privilege_name| was successfully enabled). | 121 // to know whether |privilege_name| was successfully enabled). |
119 class ScopedTokenPrivilege { | 122 class ScopedTokenPrivilege { |
120 public: | 123 public: |
121 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); | 124 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); |
122 ~ScopedTokenPrivilege(); | 125 ~ScopedTokenPrivilege(); |
(...skipping 12 matching lines...) Expand all Loading... |
135 // The previous state of the privilege this object is responsible for. As set | 138 // The previous state of the privilege this object is responsible for. As set |
136 // by AdjustTokenPrivileges() upon construction. | 139 // by AdjustTokenPrivileges() upon construction. |
137 TOKEN_PRIVILEGES previous_privileges_; | 140 TOKEN_PRIVILEGES previous_privileges_; |
138 | 141 |
139 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); | 142 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); |
140 }; | 143 }; |
141 | 144 |
142 } // namespace installer | 145 } // namespace installer |
143 | 146 |
144 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 147 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
OLD | NEW |