| 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. | 5 // This file declares util functions for setup project. |
| 6 | 6 |
| 7 #ifndef CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 7 #ifndef CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| 8 #define CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 8 #define CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| 9 | 9 |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 // Returns true if the product |type| will be installed after the current | 74 // Returns true if the product |type| will be installed after the current |
| 75 // setup.exe instance have carried out installation / uninstallation, at | 75 // setup.exe instance have carried out installation / uninstallation, at |
| 76 // the level specified by |installer_state|. | 76 // the level specified by |installer_state|. |
| 77 // This function only returns meaningful results for install and update | 77 // This function only returns meaningful results for install and update |
| 78 // operations if called after CheckPreInstallConditions (see setup_main.cc). | 78 // operations if called after CheckPreInstallConditions (see setup_main.cc). |
| 79 bool WillProductBePresentAfterSetup( | 79 bool WillProductBePresentAfterSetup( |
| 80 const installer::InstallerState& installer_state, | 80 const installer::InstallerState& installer_state, |
| 81 const installer::InstallationState& machine_state, | 81 const installer::InstallationState& machine_state, |
| 82 BrowserDistribution::Type type); | 82 BrowserDistribution::Type type); |
| 83 | 83 |
| 84 // Drops the process down to background processing mode on supported OSes if it |
| 85 // was launched below the normal process priority. Returns true when background |
| 86 // procesing mode is entered. |
| 87 bool AdjustProcessPriority(); |
| 88 |
| 84 // This class will enable the privilege defined by |privilege_name| on the | 89 // This class will enable the privilege defined by |privilege_name| on the |
| 85 // current process' token. The privilege will be disabled upon the | 90 // current process' token. The privilege will be disabled upon the |
| 86 // ScopedTokenPrivilege's destruction (unless it was already enabled when the | 91 // ScopedTokenPrivilege's destruction (unless it was already enabled when the |
| 87 // ScopedTokenPrivilege object was constructed). | 92 // ScopedTokenPrivilege object was constructed). |
| 88 // Some privileges might require admin rights to be enabled (check is_enabled() | 93 // Some privileges might require admin rights to be enabled (check is_enabled() |
| 89 // to know whether |privilege_name| was successfully enabled). | 94 // to know whether |privilege_name| was successfully enabled). |
| 90 class ScopedTokenPrivilege { | 95 class ScopedTokenPrivilege { |
| 91 public: | 96 public: |
| 92 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); | 97 explicit ScopedTokenPrivilege(const wchar_t* privilege_name); |
| 93 ~ScopedTokenPrivilege(); | 98 ~ScopedTokenPrivilege(); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 106 // The previous state of the privilege this object is responsible for. As set | 111 // The previous state of the privilege this object is responsible for. As set |
| 107 // by AdjustTokenPrivileges() upon construction. | 112 // by AdjustTokenPrivileges() upon construction. |
| 108 TOKEN_PRIVILEGES previous_privileges_; | 113 TOKEN_PRIVILEGES previous_privileges_; |
| 109 | 114 |
| 110 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); | 115 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); |
| 111 }; | 116 }; |
| 112 | 117 |
| 113 } // namespace installer | 118 } // namespace installer |
| 114 | 119 |
| 115 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 120 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
| OLD | NEW |