| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 static int GetInstallReturnCode(installer::InstallStatus install_status); | 176 static int GetInstallReturnCode(installer::InstallStatus install_status); |
| 177 | 177 |
| 178 // Composes |program| and |arguments| into |command_line|. | 178 // Composes |program| and |arguments| into |command_line|. |
| 179 static void ComposeCommandLine(const base::string16& program, | 179 static void ComposeCommandLine(const base::string16& program, |
| 180 const base::string16& arguments, | 180 const base::string16& arguments, |
| 181 base::CommandLine* command_line); | 181 base::CommandLine* command_line); |
| 182 | 182 |
| 183 // Returns a string in the form YYYYMMDD of the current date. | 183 // Returns a string in the form YYYYMMDD of the current date. |
| 184 static base::string16 GetCurrentDate(); | 184 static base::string16 GetCurrentDate(); |
| 185 | 185 |
| 186 // Returns the highest Chrome version that was installed prior to a downgrade, |
| 187 // or an invalid Version if Chrome was not previously downgraded from a newer |
| 188 // version. |
| 189 static base::Version GetDowngradeVersion(bool system_install, |
| 190 const BrowserDistribution* dist); |
| 191 |
| 192 // Adds or removes downgrade version registry value. This function should only |
| 193 // be used for Chrome install. |
| 194 static void AddUpdateDowngradeVersionItem( |
| 195 bool system_install, |
| 196 const base::Version* current_version, |
| 197 const base::Version& new_version, |
| 198 const BrowserDistribution* dist, |
| 199 WorkItemList* list); |
| 200 |
| 186 // A predicate that compares the program portion of a command line with a | 201 // A predicate that compares the program portion of a command line with a |
| 187 // given file path. First, the file paths are compared directly. If they do | 202 // given file path. First, the file paths are compared directly. If they do |
| 188 // not match, the filesystem is consulted to determine if the paths reference | 203 // not match, the filesystem is consulted to determine if the paths reference |
| 189 // the same file. | 204 // the same file. |
| 190 class ProgramCompare : public RegistryValuePredicate { | 205 class ProgramCompare : public RegistryValuePredicate { |
| 191 public: | 206 public: |
| 192 enum class ComparisonType { | 207 enum class ComparisonType { |
| 193 // Evaluation compares existing files. | 208 // Evaluation compares existing files. |
| 194 FILE, | 209 FILE, |
| 195 // Evaluation compares existing files or directories. | 210 // Evaluation compares existing files or directories. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 222 private: | 237 private: |
| 223 DISALLOW_COPY_AND_ASSIGN(ProgramCompare); | 238 DISALLOW_COPY_AND_ASSIGN(ProgramCompare); |
| 224 }; // class ProgramCompare | 239 }; // class ProgramCompare |
| 225 | 240 |
| 226 private: | 241 private: |
| 227 DISALLOW_COPY_AND_ASSIGN(InstallUtil); | 242 DISALLOW_COPY_AND_ASSIGN(InstallUtil); |
| 228 }; | 243 }; |
| 229 | 244 |
| 230 | 245 |
| 231 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ | 246 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ |
| OLD | NEW |