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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 static int GetInstallReturnCode(installer::InstallStatus install_status); | 168 static int GetInstallReturnCode(installer::InstallStatus install_status); |
169 | 169 |
170 // Composes |program| and |arguments| into |command_line|. | 170 // Composes |program| and |arguments| into |command_line|. |
171 static void MakeUninstallCommand(const string16& program, | 171 static void MakeUninstallCommand(const string16& program, |
172 const string16& arguments, | 172 const string16& arguments, |
173 CommandLine* command_line); | 173 CommandLine* command_line); |
174 | 174 |
175 // Returns a string in the form YYYYMMDD of the current date. | 175 // Returns a string in the form YYYYMMDD of the current date. |
176 static string16 GetCurrentDate(); | 176 static string16 GetCurrentDate(); |
177 | 177 |
| 178 // Sets |experiment_label| as the Omaha experiment label for the Chrome |
| 179 // product registry entries for a given |registry_hive|. |
| 180 static bool SetOmahaExperimentLabel(const string16& experiment_label, |
| 181 HKEY registry_hive); |
| 182 |
178 // A predicate that compares the program portion of a command line with a | 183 // A predicate that compares the program portion of a command line with a |
179 // given file path. First, the file paths are compared directly. If they do | 184 // given file path. First, the file paths are compared directly. If they do |
180 // not match, the filesystem is consulted to determine if the paths reference | 185 // not match, the filesystem is consulted to determine if the paths reference |
181 // the same file. | 186 // the same file. |
182 class ProgramCompare : public RegistryValuePredicate { | 187 class ProgramCompare : public RegistryValuePredicate { |
183 public: | 188 public: |
184 explicit ProgramCompare(const FilePath& path_to_match); | 189 explicit ProgramCompare(const FilePath& path_to_match); |
185 virtual ~ProgramCompare(); | 190 virtual ~ProgramCompare(); |
186 virtual bool Evaluate(const string16& value) const OVERRIDE; | 191 virtual bool Evaluate(const string16& value) const OVERRIDE; |
187 | 192 |
(...skipping 10 matching lines...) Expand all Loading... |
198 private: | 203 private: |
199 DISALLOW_COPY_AND_ASSIGN(ProgramCompare); | 204 DISALLOW_COPY_AND_ASSIGN(ProgramCompare); |
200 }; // class ProgramCompare | 205 }; // class ProgramCompare |
201 | 206 |
202 private: | 207 private: |
203 DISALLOW_COPY_AND_ASSIGN(InstallUtil); | 208 DISALLOW_COPY_AND_ASSIGN(InstallUtil); |
204 }; | 209 }; |
205 | 210 |
206 | 211 |
207 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ | 212 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ |
OLD | NEW |