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 utility functions for the installer. The original reason | 5 // This file declares utility functions for the installer. The original reason |
6 // for putting these functions in installer\util library is so that we can | 6 // for putting these functions in installer\util library is so that we can |
7 // separate out the critical logic and write unit tests for it. | 7 // separate out the critical logic and write unit tests for it. |
8 | 8 |
9 #ifndef CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ | 9 #ifndef CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ |
10 #define CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ | 10 #define CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // indicated by the presence of --chrome-sxs on the command line) or if this | 91 // indicated by the presence of --chrome-sxs on the command line) or if this |
92 // is running Chrome process from the Chrome SxS installation (as indicated | 92 // is running Chrome process from the Chrome SxS installation (as indicated |
93 // by either --chrome-sxs or the executable path). | 93 // by either --chrome-sxs or the executable path). |
94 static bool IsChromeSxSProcess(); | 94 static bool IsChromeSxSProcess(); |
95 | 95 |
96 // Returns true if the Chrome installed at |chrome_exe| has a Windows shell | 96 // Returns true if the Chrome installed at |chrome_exe| has a Windows shell |
97 // DelegateExecute verb handler. | 97 // DelegateExecute verb handler. |
98 static bool HasDelegateExecuteHandler(BrowserDistribution* dist, | 98 static bool HasDelegateExecuteHandler(BrowserDistribution* dist, |
99 const string16& chrome_exe); | 99 const string16& chrome_exe); |
100 | 100 |
| 101 // Populates |path| with the path to |file| in the sentinel directory. This is |
| 102 // the application directory for user-level installs, and the default user |
| 103 // data dir for system-level installs. Returns false on error. |
| 104 static bool GetSentinelFilePath(const char* file, |
| 105 BrowserDistribution* dist, |
| 106 FilePath* path); |
| 107 |
101 // Deletes the registry key at path key_path under the key given by root_key. | 108 // Deletes the registry key at path key_path under the key given by root_key. |
102 static bool DeleteRegistryKey(HKEY root_key, const string16& key_path); | 109 static bool DeleteRegistryKey(HKEY root_key, const string16& key_path); |
103 | 110 |
104 // Deletes the registry value named value_name at path key_path under the key | 111 // Deletes the registry value named value_name at path key_path under the key |
105 // given by reg_root. | 112 // given by reg_root. |
106 static bool DeleteRegistryValue(HKEY reg_root, const string16& key_path, | 113 static bool DeleteRegistryValue(HKEY reg_root, const string16& key_path, |
107 const string16& value_name); | 114 const string16& value_name); |
108 | 115 |
109 // An interface to a predicate function for use by DeleteRegistryKeyIf and | 116 // An interface to a predicate function for use by DeleteRegistryKeyIf and |
110 // DeleteRegistryValueIf. | 117 // DeleteRegistryValueIf. |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 private: | 194 private: |
188 DISALLOW_COPY_AND_ASSIGN(ProgramCompare); | 195 DISALLOW_COPY_AND_ASSIGN(ProgramCompare); |
189 }; // class ProgramCompare | 196 }; // class ProgramCompare |
190 | 197 |
191 private: | 198 private: |
192 DISALLOW_COPY_AND_ASSIGN(InstallUtil); | 199 DISALLOW_COPY_AND_ASSIGN(InstallUtil); |
193 }; | 200 }; |
194 | 201 |
195 | 202 |
196 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ | 203 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ |
OLD | NEW |