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 | |
141 // This class will enable the privilege defined by |privilege_name| on the | 137 // This class will enable the privilege defined by |privilege_name| on the |
142 // current process' token. The privilege will be disabled upon the | 138 // current process' token. The privilege will be disabled upon the |
143 // ScopedTokenPrivilege's destruction (unless it was already enabled when the | 139 // ScopedTokenPrivilege's destruction (unless it was already enabled when the |
144 // ScopedTokenPrivilege object was constructed). | 140 // ScopedTokenPrivilege object was constructed). |
145 // Some privileges might require admin rights to be enabled (check is_enabled() | 141 // Some privileges might require admin rights to be enabled (check is_enabled() |
146 // to know whether |privilege_name| was successfully enabled). | 142 // to know whether |privilege_name| was successfully enabled). |
147 class ScopedTokenPrivilege { | 143 class ScopedTokenPrivilege { |
148 public: | 144 public: |
149 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); | 145 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); |
150 ~ScopedTokenPrivilege(); | 146 ~ScopedTokenPrivilege(); |
(...skipping 12 matching lines...) Expand all Loading... |
163 // The previous state of the privilege this object is responsible for. As set | 159 // The previous state of the privilege this object is responsible for. As set |
164 // by AdjustTokenPrivileges() upon construction. | 160 // by AdjustTokenPrivileges() upon construction. |
165 TOKEN_PRIVILEGES previous_privileges_; | 161 TOKEN_PRIVILEGES previous_privileges_; |
166 | 162 |
167 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); | 163 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); |
168 }; | 164 }; |
169 | 165 |
170 } // namespace installer | 166 } // namespace installer |
171 | 167 |
172 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 168 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
OLD | NEW |