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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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. | 113 // Returns true if |cmd_line| contains unsupported (legacy) switches. |
114 bool ContainsUnsupportedSwitch(const CommandLine& cmd_line); | 114 bool ContainsUnsupportedSwitch(const CommandLine& cmd_line); |
115 | 115 |
| 116 // Returns true if the processor is supported by chrome. |
| 117 bool IsProcessorSupported(); |
| 118 |
116 // This class will enable the privilege defined by |privilege_name| on the | 119 // This class will enable the privilege defined by |privilege_name| on the |
117 // current process' token. The privilege will be disabled upon the | 120 // current process' token. The privilege will be disabled upon the |
118 // ScopedTokenPrivilege's destruction (unless it was already enabled when the | 121 // ScopedTokenPrivilege's destruction (unless it was already enabled when the |
119 // ScopedTokenPrivilege object was constructed). | 122 // ScopedTokenPrivilege object was constructed). |
120 // Some privileges might require admin rights to be enabled (check is_enabled() | 123 // Some privileges might require admin rights to be enabled (check is_enabled() |
121 // to know whether |privilege_name| was successfully enabled). | 124 // to know whether |privilege_name| was successfully enabled). |
122 class ScopedTokenPrivilege { | 125 class ScopedTokenPrivilege { |
123 public: | 126 public: |
124 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); | 127 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); |
125 ~ScopedTokenPrivilege(); | 128 ~ScopedTokenPrivilege(); |
(...skipping 12 matching lines...) Expand all Loading... |
138 // The previous state of the privilege this object is responsible for. As set | 141 // The previous state of the privilege this object is responsible for. As set |
139 // by AdjustTokenPrivileges() upon construction. | 142 // by AdjustTokenPrivileges() upon construction. |
140 TOKEN_PRIVILEGES previous_privileges_; | 143 TOKEN_PRIVILEGES previous_privileges_; |
141 | 144 |
142 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); | 145 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); |
143 }; | 146 }; |
144 | 147 |
145 } // namespace installer | 148 } // namespace installer |
146 | 149 |
147 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 150 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
OLD | NEW |