Chromium Code Reviews| 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 26 matching lines...) Expand all Loading... | |
| 37 static base::string16 GetActiveSetupPath(BrowserDistribution* dist); | 37 static base::string16 GetActiveSetupPath(BrowserDistribution* dist); |
| 38 | 38 |
| 39 // Attempts to trigger the command that would be run by Active Setup for a | 39 // Attempts to trigger the command that would be run by Active Setup for a |
| 40 // system-level Chrome. For use only when system-level Chrome is installed. | 40 // system-level Chrome. For use only when system-level Chrome is installed. |
| 41 static void TriggerActiveSetupCommand(); | 41 static void TriggerActiveSetupCommand(); |
| 42 | 42 |
| 43 // Launches given exe as admin on Vista. | 43 // Launches given exe as admin on Vista. |
| 44 static bool ExecuteExeAsAdmin(const base::CommandLine& cmd, DWORD* exit_code); | 44 static bool ExecuteExeAsAdmin(const base::CommandLine& cmd, DWORD* exit_code); |
| 45 | 45 |
| 46 // Reads the uninstall command for Chromium from registry and returns it. | 46 // Reads the uninstall command for Chromium from registry and returns it. |
| 47 // If system_install is true the command is read from HKLM, otherwise | 47 // If system_install is true the command is read from HKLM, otherwise |
|
huangs
2017/01/09 09:09:10
NIT: Unwrap; and use |system_install|. Also should
grt (UTC plus 2)
2017/01/09 10:11:45
Done.
| |
| 48 // from HKCU. | 48 // from HKCU. |
| 49 static base::CommandLine GetChromeUninstallCmd( | 49 static base::CommandLine GetChromeUninstallCmd(bool system_install); |
| 50 bool system_install, | |
| 51 BrowserDistribution::Type distribution_type); | |
| 52 | 50 |
| 53 // Find the version of Chrome installed on the system by checking the | 51 // Find the version of Chrome installed on the system by checking the |
| 54 // Google Update registry key. Fills |version| with the version or a | 52 // Google Update registry key. Fills |version| with the version or a |
| 55 // default-constructed Version if no version is found. | 53 // default-constructed Version if no version is found. |
| 56 // system_install: if true, looks for version number under the HKLM root, | 54 // system_install: if true, looks for version number under the HKLM root, |
| 57 // otherwise looks under the HKCU. | 55 // otherwise looks under the HKCU. |
| 58 static void GetChromeVersion(BrowserDistribution* dist, | 56 static void GetChromeVersion(BrowserDistribution* dist, |
| 59 bool system_install, | 57 bool system_install, |
| 60 base::Version* version); | 58 base::Version* version); |
| 61 | 59 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 217 private: | 215 private: |
| 218 DISALLOW_COPY_AND_ASSIGN(ProgramCompare); | 216 DISALLOW_COPY_AND_ASSIGN(ProgramCompare); |
| 219 }; // class ProgramCompare | 217 }; // class ProgramCompare |
| 220 | 218 |
| 221 private: | 219 private: |
| 222 DISALLOW_COPY_AND_ASSIGN(InstallUtil); | 220 DISALLOW_COPY_AND_ASSIGN(InstallUtil); |
| 223 }; | 221 }; |
| 224 | 222 |
| 225 | 223 |
| 226 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ | 224 #endif // CHROME_INSTALLER_UTIL_INSTALL_UTIL_H_ |
| OLD | NEW |