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> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "base/win/scoped_handle.h" | 14 #include "base/win/scoped_handle.h" |
15 #include "chrome/installer/util/browser_distribution.h" | 15 #include "chrome/installer/util/browser_distribution.h" |
16 #include "chrome/installer/util/util_constants.h" | 16 #include "chrome/installer/util/util_constants.h" |
17 | 17 |
18 class CommandLine; | 18 class CommandLine; |
19 class Version; | |
20 | 19 |
21 namespace base { | 20 namespace base { |
22 class FilePath; | 21 class FilePath; |
| 22 class Version; |
23 } | 23 } |
24 | 24 |
25 namespace installer { | 25 namespace installer { |
26 | 26 |
27 class InstallationState; | 27 class InstallationState; |
28 class InstallerState; | 28 class InstallerState; |
29 class ProductState; | 29 class ProductState; |
30 | 30 |
31 // Apply a diff patch to source file. First tries to apply it using courgette | 31 // Apply a diff patch to source file. First tries to apply it using courgette |
32 // since it checks for courgette header and fails quickly. If that fails | 32 // since it checks for courgette header and fails quickly. If that fails |
(...skipping 17 matching lines...) Expand all Loading... |
50 // given the nature of this function, it is not possible to know if the | 50 // given the nature of this function, it is not possible to know if the |
51 // delete operation itself succeeded. | 51 // delete operation itself succeeded. |
52 bool DeleteFileFromTempProcess(const base::FilePath& path, | 52 bool DeleteFileFromTempProcess(const base::FilePath& path, |
53 uint32 delay_before_delete_ms); | 53 uint32 delay_before_delete_ms); |
54 | 54 |
55 // Returns true and populates |setup_exe| with the path to an existing product | 55 // Returns true and populates |setup_exe| with the path to an existing product |
56 // installer if one is found that is newer than the currently running installer | 56 // installer if one is found that is newer than the currently running installer |
57 // (|installer_version|). | 57 // (|installer_version|). |
58 bool GetExistingHigherInstaller(const InstallationState& original_state, | 58 bool GetExistingHigherInstaller(const InstallationState& original_state, |
59 bool system_install, | 59 bool system_install, |
60 const Version& installer_version, | 60 const base::Version& installer_version, |
61 base::FilePath* setup_exe); | 61 base::FilePath* setup_exe); |
62 | 62 |
63 // Invokes the pre-existing |setup_exe| to handle the current operation (as | 63 // Invokes the pre-existing |setup_exe| to handle the current operation (as |
64 // dictated by |command_line|). An installerdata file, if specified, is first | 64 // dictated by |command_line|). An installerdata file, if specified, is first |
65 // unconditionally copied into place so that it will be in effect in case the | 65 // unconditionally copied into place so that it will be in effect in case the |
66 // invoked |setup_exe| runs the newly installed product prior to exiting. | 66 // invoked |setup_exe| runs the newly installed product prior to exiting. |
67 // Returns true if |setup_exe| was launched, false otherwise. | 67 // Returns true if |setup_exe| was launched, false otherwise. |
68 bool DeferToExistingInstall(const base::FilePath& setup_exe, | 68 bool DeferToExistingInstall(const base::FilePath& setup_exe, |
69 const CommandLine& command_line, | 69 const CommandLine& command_line, |
70 const InstallerState& installer_state, | 70 const InstallerState& installer_state, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // The previous state of the privilege this object is responsible for. As set | 106 // The previous state of the privilege this object is responsible for. As set |
107 // by AdjustTokenPrivileges() upon construction. | 107 // by AdjustTokenPrivileges() upon construction. |
108 TOKEN_PRIVILEGES previous_privileges_; | 108 TOKEN_PRIVILEGES previous_privileges_; |
109 | 109 |
110 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); | 110 DISALLOW_IMPLICIT_CONSTRUCTORS(ScopedTokenPrivilege); |
111 }; | 111 }; |
112 | 112 |
113 } // namespace installer | 113 } // namespace installer |
114 | 114 |
115 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ | 115 #endif // CHROME_INSTALLER_SETUP_SETUP_UTIL_H_ |
OLD | NEW |