Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H_ | 5 #ifndef CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H_ |
| 6 #define CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H_ | 6 #define CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
| 13 #include "base/file_path.h" | 13 #include "base/file_path.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 | 15 |
| 16 // This class has methods to install and uninstall Chrome mini installer. | 16 // This class has methods to install and uninstall Chrome mini installer. |
| 17 class ChromeMiniInstaller { | 17 class ChromeMiniInstaller { |
| 18 public: | 18 public: |
| 19 ChromeMiniInstaller(const std::wstring& install_type, bool is_chrome_frame); | 19 ChromeMiniInstaller(bool system_install, bool is_chrome_frame); |
| 20 ~ChromeMiniInstaller() {} | 20 ~ChromeMiniInstaller() {} |
| 21 | 21 |
| 22 enum RepairChrome { | 22 enum RepairChrome { |
| 23 REGISTRY, | 23 REGISTRY, |
| 24 VERSION_FOLDER | 24 VERSION_FOLDER |
| 25 }; | 25 }; |
| 26 | 26 |
| 27 // This method returns path to either program files | 27 // This method returns path to either program files |
| 28 // or documents and setting based on the install type. | 28 // or documents and setting based on the install type. |
| 29 std::wstring GetChromeInstallDirectoryLocation(); | 29 bool GetChromeInstallDirectoryLocation(FilePath* path); |
| 30 | 30 |
| 31 // Installs the latest full installer. | 31 // Installs the latest full installer. |
| 32 void InstallFullInstaller(bool over_install); | 32 void InstallFullInstaller(bool over_install); |
| 33 | 33 |
| 34 void ChromeMiniInstaller::InstallUsingMultiInstall(); | |
|
kkania
2011/09/26 20:00:53
You don't need the ChromeMiniInstaller:: part.
Huyen
2011/09/27 23:00:24
Done.
| |
| 35 | |
| 36 void VerifyMultiInstall(); | |
|
kkania
2011/09/26 20:00:53
This doesn't need to be public. It doesn't really
Huyen
2011/09/27 23:00:24
Done.
| |
| 37 | |
| 34 // Installs chrome. | 38 // Installs chrome. |
| 35 void Install(); | 39 void Install(); |
| 36 | 40 |
| 37 // This method will first install the full installer and | 41 // This method will first install the full installer and |
| 38 // then over installs with diff installer. If |should_start_ie| is true, | 42 // then over installs with diff installer. If |should_start_ie| is true, |
| 39 // start IE browser before launch installer, and leave the process running | 43 // start IE browser before launch installer, and leave the process running |
| 40 // through the installtions. | 44 // through the installtions. |
| 41 void OverInstallOnFullInstaller(const std::wstring& install_type, | 45 void OverInstallOnFullInstaller(const std::wstring& install_type, |
| 42 bool should_start_ie); | 46 bool should_start_ie); |
| 43 | 47 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 | 99 |
| 96 // Get HKEY based on install type. | 100 // Get HKEY based on install type. |
| 97 HKEY GetRootRegistryKey(); | 101 HKEY GetRootRegistryKey(); |
| 98 | 102 |
| 99 // Returns Chrome pv registry key value. | 103 // Returns Chrome pv registry key value. |
| 100 bool GetChromeVersionFromRegistry(std::wstring* reg_key_value); | 104 bool GetChromeVersionFromRegistry(std::wstring* reg_key_value); |
| 101 | 105 |
| 102 // This method gets the shortcut path from start menu based on install type. | 106 // This method gets the shortcut path from start menu based on install type. |
| 103 FilePath GetStartMenuShortcutPath(); | 107 FilePath GetStartMenuShortcutPath(); |
| 104 | 108 |
| 105 // Get path for uninstall. | |
| 106 std::wstring GetUninstallPath(); | |
| 107 | |
| 108 // Get user data directory path. | 109 // Get user data directory path. |
| 109 FilePath GetUserDataDirPath(); | 110 FilePath GetUserDataDirPath(); |
| 110 | 111 |
| 111 // Gets the path to launch Chrome. | 112 // Launch Chrome. Kill process if |kill| is true. |
| 112 bool GetChromeLaunchPath(FilePath* launch_path); | 113 void LaunchChrome(const bool kill); |
|
kkania
2011/09/26 20:00:53
the style guide says don't use const with a primit
Huyen
2011/09/27 23:00:24
Done.
| |
| 113 | |
| 114 // This method will get Chrome.exe path and launch it. | |
| 115 void VerifyChromeLaunch(bool expected_status); | |
| 116 | 114 |
| 117 // This method verifies if Chrome/Chrome Frame installed correctly. | 115 // This method verifies if Chrome/Chrome Frame installed correctly. |
| 118 void VerifyInstall(bool over_install); | 116 void VerifyInstall(bool over_install); |
| 119 | 117 |
| 120 // This method verifies installation of Chrome/Chrome Frame via machine | |
| 121 // introspection. | |
| 122 void VerifyMachineState(); | |
| 123 | |
| 124 // This method will verify if ChromeFrame got successfully installed on the | 118 // This method will verify if ChromeFrame got successfully installed on the |
| 125 // machine. | 119 // machine. |
| 126 void VerifyChromeFrameInstall(); | 120 void VerifyChromeFrameInstall(); |
| 127 | 121 |
| 128 // Launch IE with |navigate_url|. | 122 // Launch IE with |navigate_url|. |
| 129 void LaunchIE(const std::wstring& navigate_url); | 123 void LaunchIE(const std::wstring& navigate_url); |
| 130 | 124 |
| 131 // Launches the chrome installer and waits for it to end. | 125 // Launch installer using provide |args|. |
| 132 void LaunchInstaller(const FilePath& path, | 126 void LaunchInstaller(const FilePath& path, const CommandLine& args); |
|
kkania
2011/09/26 20:00:53
any reason not to just pass a CommandLine, since i
Huyen
2011/09/27 23:00:24
Good point. Now using CommandLine.
| |
| 133 const wchar_t* process_name); | |
| 134 | |
| 135 // Verifies if Chrome launches after install. | |
| 136 void LaunchAndCloseChrome(bool over_install); | |
| 137 | |
| 138 // Launches any requested browser. | |
| 139 void LaunchBrowser(const FilePath& path, | |
| 140 const std::wstring& args, | |
| 141 bool expected_status); | |
| 142 | 127 |
| 143 // Compares the registry key values after overinstall. | 128 // Compares the registry key values after overinstall. |
| 144 bool VerifyOverInstall(const std::wstring& reg_key_value_before_overinstall, | 129 bool VerifyOverInstall(const std::wstring& reg_key_value_before_overinstall, |
| 145 const std::wstring& reg_key_value_after_overinstall); | 130 const std::wstring& reg_key_value_after_overinstall); |
| 146 | 131 |
| 147 // This method will verify if the installed build is correct. | 132 // This method will verify if the installed build is correct. |
| 148 bool VerifyStandaloneInstall(); | 133 bool VerifyStandaloneInstall(); |
| 149 | 134 |
| 150 // Get all the latest installers base on last modified date. | 135 // Get all the latest installers base on last modified date. |
| 151 bool LocateInstallers(const std::wstring& build); | 136 bool LocateInstallers(const std::wstring& build); |
| 152 | 137 |
| 153 // This method will create a command line to run apply tag. | 138 // This method will create a command line to run apply tag. |
| 154 CommandLine GetCommandForTagging(); | 139 CommandLine GetCommandForTagging(); |
| 155 | 140 |
| 156 // This variable holds the install type. | 141 // If true install system level. Otherwise install user level. |
| 157 // Install type can be either system or user level. | 142 bool system_install_; |
| 158 std::wstring install_type_; | |
| 159 | 143 |
| 160 bool is_chrome_frame_; | 144 bool is_chrome_frame_; |
| 161 | 145 |
| 162 FilePath full_installer_; | 146 FilePath full_installer_; |
| 163 FilePath diff_installer_; | 147 FilePath diff_installer_; |
| 164 FilePath previous_installer_; | 148 FilePath previous_installer_; |
| 165 FilePath standalone_installer_; | 149 FilePath standalone_installer_; |
| 150 FilePath mini_installer_; | |
| 166 | 151 |
| 167 // Build numbers. | 152 // Build numbers. |
| 168 std::wstring current_build_, previous_build_; | 153 std::wstring current_build_, previous_build_; |
| 169 | 154 |
| 170 DISALLOW_COPY_AND_ASSIGN(ChromeMiniInstaller); | 155 DISALLOW_COPY_AND_ASSIGN(ChromeMiniInstaller); |
| 171 }; | 156 }; |
| 172 | 157 |
| 173 #endif // CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H_ | 158 #endif // CHROME_TEST_MINI_INSTALLER_TEST_CHROME_MINI_INSTALLER_H_ |
| OLD | NEW |