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_INSTALLER_UTIL_INSTALLER_STATE_H_ | 5 #ifndef CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ |
6 #define CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ | 6 #define CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 Operation operation() const { return operation_; } | 98 Operation operation() const { return operation_; } |
99 | 99 |
100 // A convenience method returning level() == SYSTEM_LEVEL. | 100 // A convenience method returning level() == SYSTEM_LEVEL. |
101 // TODO(grt): Eradicate the bool in favor of the enum. | 101 // TODO(grt): Eradicate the bool in favor of the enum. |
102 bool system_install() const; | 102 bool system_install() const; |
103 | 103 |
104 // A convenience method returning package_type() == MULTI_PACKAGE. | 104 // A convenience method returning package_type() == MULTI_PACKAGE. |
105 // TODO(grt): Eradicate the bool in favor of the enum. | 105 // TODO(grt): Eradicate the bool in favor of the enum. |
106 bool is_multi_install() const; | 106 bool is_multi_install() const; |
107 | 107 |
108 // Returns whether or not there is currently a Chrome Frame instance running. | |
109 // Note that there isn't a mechanism to lock Chrome Frame in place, so Chrome | |
110 // Frame may either exit or start up after this is called. | |
111 bool is_chrome_frame_running() const { return is_chrome_frame_running_; } | |
112 | |
113 // The full path to the place where the operand resides. | 108 // The full path to the place where the operand resides. |
114 const FilePath& target_path() const { return target_path_; } | 109 const FilePath& target_path() const { return target_path_; } |
115 | 110 |
116 // True if the "msi" preference is set or if a product with the "msi" state | 111 // True if the "msi" preference is set or if a product with the "msi" state |
117 // flag is set is to be operated on. | 112 // flag is set is to be operated on. |
118 bool is_msi() const { return msi_; } | 113 bool is_msi() const { return msi_; } |
119 | 114 |
120 // True if the --verbose-logging command-line flag is set or if the | 115 // True if the --verbose-logging command-line flag is set or if the |
121 // verbose_logging master preferences option is true. | 116 // verbose_logging master preferences option is true. |
122 bool verbose_logging() const { return verbose_logging_; } | 117 bool verbose_logging() const { return verbose_logging_; } |
(...skipping 19 matching lines...) Expand all Loading... |
142 | 137 |
143 const Products& products() const { return products_.get(); } | 138 const Products& products() const { return products_.get(); } |
144 | 139 |
145 // Returns the product of the desired type, or NULL if none found. | 140 // Returns the product of the desired type, or NULL if none found. |
146 const Product* FindProduct(BrowserDistribution::Type distribution_type) const; | 141 const Product* FindProduct(BrowserDistribution::Type distribution_type) const; |
147 | 142 |
148 // Returns the currently installed version in |target_path|, or NULL if no | 143 // Returns the currently installed version in |target_path|, or NULL if no |
149 // products are installed. Ownership is passed to the caller. | 144 // products are installed. Ownership is passed to the caller. |
150 Version* GetCurrentVersion(const InstallationState& machine_state) const; | 145 Version* GetCurrentVersion(const InstallationState& machine_state) const; |
151 | 146 |
| 147 // Returns whether or not there is currently a Chrome Frame instance running. |
| 148 // Note that there isn't a mechanism to lock Chrome Frame in place, so Chrome |
| 149 // Frame may either exit or start up after this is called. |
| 150 bool IsChromeFrameRunning(const InstallationState& machine_state) const; |
| 151 |
152 // Returns the path to the installer under Chrome version folder | 152 // Returns the path to the installer under Chrome version folder |
153 // (for example <target_path>\Google\Chrome\Application\<Version>\Installer) | 153 // (for example <target_path>\Google\Chrome\Application\<Version>\Installer) |
154 FilePath GetInstallerDirectory(const Version& version) const; | 154 FilePath GetInstallerDirectory(const Version& version) const; |
155 | 155 |
156 // Try to delete all directories under |temp_path| whose versions are less | 156 // Try to delete all directories under |temp_path| whose versions are less |
157 // than |new_version| and not equal to |existing_version|. |existing_version| | 157 // than |new_version| and not equal to |existing_version|. |existing_version| |
158 // may be NULL. | 158 // may be NULL. |
159 void RemoveOldVersionDirectories(const Version& new_version, | 159 void RemoveOldVersionDirectories(const Version& new_version, |
160 Version* existing_version, | 160 Version* existing_version, |
161 const FilePath& temp_path) const; | 161 const FilePath& temp_path) const; |
(...skipping 28 matching lines...) Expand all Loading... |
190 FilePath GetDefaultProductInstallPath(BrowserDistribution* dist) const; | 190 FilePath GetDefaultProductInstallPath(BrowserDistribution* dist) const; |
191 bool CanAddProduct(const Product& product, const FilePath* product_dir) const; | 191 bool CanAddProduct(const Product& product, const FilePath* product_dir) const; |
192 Product* AddProductInDirectory(const FilePath* product_dir, | 192 Product* AddProductInDirectory(const FilePath* product_dir, |
193 scoped_ptr<Product>* product); | 193 scoped_ptr<Product>* product); |
194 Product* AddProductFromPreferences( | 194 Product* AddProductFromPreferences( |
195 BrowserDistribution::Type distribution_type, | 195 BrowserDistribution::Type distribution_type, |
196 const MasterPreferences& prefs, | 196 const MasterPreferences& prefs, |
197 const InstallationState& machine_state); | 197 const InstallationState& machine_state); |
198 bool IsMultiInstallUpdate(const MasterPreferences& prefs, | 198 bool IsMultiInstallUpdate(const MasterPreferences& prefs, |
199 const InstallationState& machine_state); | 199 const InstallationState& machine_state); |
200 bool DetectChromeFrameInUse(const InstallationState& machine_state); | |
201 | 200 |
202 // Sets this object's level and updates the root_key_ accordingly. | 201 // Sets this object's level and updates the root_key_ accordingly. |
203 void set_level(Level level); | 202 void set_level(Level level); |
204 | 203 |
205 // Sets this object's package type and updates the multi_package_distribution_ | 204 // Sets this object's package type and updates the multi_package_distribution_ |
206 // accordingly. | 205 // accordingly. |
207 void set_package_type(PackageType type); | 206 void set_package_type(PackageType type); |
208 | 207 |
209 Operation operation_; | 208 Operation operation_; |
210 FilePath target_path_; | 209 FilePath target_path_; |
211 std::wstring state_key_; | 210 std::wstring state_key_; |
212 BrowserDistribution::Type state_type_; | 211 BrowserDistribution::Type state_type_; |
213 ScopedVector<Product> products_; | 212 ScopedVector<Product> products_; |
214 BrowserDistribution* multi_package_distribution_; | 213 BrowserDistribution* multi_package_distribution_; |
215 Level level_; | 214 Level level_; |
216 PackageType package_type_; | 215 PackageType package_type_; |
217 #if defined(OS_WIN) | 216 #if defined(OS_WIN) |
218 HKEY root_key_; | 217 HKEY root_key_; |
219 #endif | 218 #endif |
220 bool msi_; | 219 bool msi_; |
221 bool verbose_logging_; | 220 bool verbose_logging_; |
222 bool is_chrome_frame_running_; | |
223 | 221 |
224 private: | 222 private: |
225 DISALLOW_COPY_AND_ASSIGN(InstallerState); | 223 DISALLOW_COPY_AND_ASSIGN(InstallerState); |
226 }; // class InstallerState | 224 }; // class InstallerState |
227 | 225 |
228 } // namespace installer | 226 } // namespace installer |
229 | 227 |
230 #endif // CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ | 228 #endif // CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ |
OLD | NEW |