| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 const wchar_t* name); | 127 const wchar_t* name); |
| 128 | 128 |
| 129 // Deletes all values and subkeys of the key |path| under |root|, preserving | 129 // Deletes all values and subkeys of the key |path| under |root|, preserving |
| 130 // the keys named in |keys_to_preserve| (each of which must be an ASCII string). | 130 // the keys named in |keys_to_preserve| (each of which must be an ASCII string). |
| 131 // The key itself is deleted if no subkeys are preserved. | 131 // The key itself is deleted if no subkeys are preserved. |
| 132 void DeleteRegistryKeyPartial( | 132 void DeleteRegistryKeyPartial( |
| 133 HKEY root, | 133 HKEY root, |
| 134 const base::string16& path, | 134 const base::string16& path, |
| 135 const std::vector<base::string16>& keys_to_preserve); | 135 const std::vector<base::string16>& keys_to_preserve); |
| 136 | 136 |
| 137 // Converts a product GUID into a SQuished gUID that is used for MSI installer |
| 138 // registry entries. |
| 139 base::string16 GuidToSquid(const base::string16& guid); |
| 140 |
| 137 // This class will enable the privilege defined by |privilege_name| on the | 141 // This class will enable the privilege defined by |privilege_name| on the |
| 138 // current process' token. The privilege will be disabled upon the | 142 // current process' token. The privilege will be disabled upon the |
| 139 // ScopedTokenPrivilege's destruction (unless it was already enabled when the | 143 // ScopedTokenPrivilege's destruction (unless it was already enabled when the |
| 140 // ScopedTokenPrivilege object was constructed). | 144 // ScopedTokenPrivilege object was constructed). |
| 141 // Some privileges might require admin rights to be enabled (check is_enabled() | 145 // Some privileges might require admin rights to be enabled (check is_enabled() |
| 142 // to know whether |privilege_name| was successfully enabled). | 146 // to know whether |privilege_name| was successfully enabled). |
| 143 class ScopedTokenPrivilege { | 147 class ScopedTokenPrivilege { |
| 144 public: | 148 public: |
| 145 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); | 149 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); |
| 146 ~ScopedTokenPrivilege(); | 150 ~ScopedTokenPrivilege(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 159 // The previous state of the privilege this object is responsible for. As set | 163 // The previous state of the privilege this object is responsible for. As set |
| 160 // by AdjustTokenPrivileges() upon construction. | 164 // by AdjustTokenPrivileges() upon construction. |
| 161 TOKEN_PRIVILEGES previous_privileges_; | 165 TOKEN_PRIVILEGES previous_privileges_; |
| 162 | 166 |
| 163 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); | 167 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); |
| 164 }; | 168 }; |
| 165 | 169 |
| 166 } // namespace installer | 170 } // namespace installer |
| 167 | 171 |
| 168 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 172 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| OLD | NEW |