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> |
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/logging.h" | 14 #include "base/logging.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
17 #include "base/version.h" | |
17 #include "chrome/installer/util/browser_distribution.h" | 18 #include "chrome/installer/util/browser_distribution.h" |
18 #include "chrome/installer/util/product.h" | 19 #include "chrome/installer/util/product.h" |
19 #include "chrome/installer/util/util_constants.h" | 20 #include "chrome/installer/util/util_constants.h" |
20 | 21 |
21 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
22 #include <windows.h> // NOLINT | 23 #include <windows.h> // NOLINT |
23 #endif | 24 #endif |
24 | 25 |
25 class CommandLine; | 26 class CommandLine; |
26 class Version; | 27 class Version; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
137 | 138 |
138 const Products& products() const { return products_.get(); } | 139 const Products& products() const { return products_.get(); } |
139 | 140 |
140 // Returns the product of the desired type, or NULL if none found. | 141 // Returns the product of the desired type, or NULL if none found. |
141 const Product* FindProduct(BrowserDistribution::Type distribution_type) const; | 142 const Product* FindProduct(BrowserDistribution::Type distribution_type) const; |
142 | 143 |
143 // Returns the currently installed version in |target_path|, or NULL if no | 144 // Returns the currently installed version in |target_path|, or NULL if no |
144 // products are installed. Ownership is passed to the caller. | 145 // products are installed. Ownership is passed to the caller. |
145 Version* GetCurrentVersion(const InstallationState& machine_state) const; | 146 Version* GetCurrentVersion(const InstallationState& machine_state) const; |
146 | 147 |
148 // Returns the critical update version if all of the following are true: | |
149 // - --critical-update-version=CUV was specified on the command-line. | |
150 // - current_version == NULL or current_version < CUV. | |
Finnur
2011/11/11 10:31:01
Wait... current_version can be NULL? How come? Is
grt (UTC plus 2)
2011/11/11 11:40:08
It's a case where the registry data for the curren
Finnur
2011/11/11 12:12:47
I see.
On 2011/11/11 11:40:08, grt wrote:
| |
151 // - new_version >= CUV. | |
Finnur
2011/11/11 10:31:01
nit: Maybe use * for bullets instead of - so that
grt (UTC plus 2)
2011/11/11 11:40:08
Done.
| |
152 // Otherwise, returns an invalid version. | |
153 Version DetermineCriticalVersion(const Version* current_version, | |
154 const Version& new_version) const; | |
155 | |
147 // Returns whether or not there is currently a Chrome Frame instance running. | 156 // 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 | 157 // 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. | 158 // Frame may either exit or start up after this is called. |
150 bool IsChromeFrameRunning(const InstallationState& machine_state) const; | 159 bool IsChromeFrameRunning(const InstallationState& machine_state) const; |
151 | 160 |
152 // Returns the path to the installer under Chrome version folder | 161 // Returns the path to the installer under Chrome version folder |
153 // (for example <target_path>\Google\Chrome\Application\<Version>\Installer) | 162 // (for example <target_path>\Google\Chrome\Application\<Version>\Installer) |
154 FilePath GetInstallerDirectory(const Version& version) const; | 163 FilePath GetInstallerDirectory(const Version& version) const; |
155 | 164 |
156 // Try to delete all directories under |temp_path| whose versions are less | 165 // Try to delete all directories under |temp_path| whose versions are less |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
204 // Sets this object's package type and updates the multi_package_distribution_ | 213 // Sets this object's package type and updates the multi_package_distribution_ |
205 // accordingly. | 214 // accordingly. |
206 void set_package_type(PackageType type); | 215 void set_package_type(PackageType type); |
207 | 216 |
208 Operation operation_; | 217 Operation operation_; |
209 FilePath target_path_; | 218 FilePath target_path_; |
210 std::wstring state_key_; | 219 std::wstring state_key_; |
211 BrowserDistribution::Type state_type_; | 220 BrowserDistribution::Type state_type_; |
212 ScopedVector<Product> products_; | 221 ScopedVector<Product> products_; |
213 BrowserDistribution* multi_package_distribution_; | 222 BrowserDistribution* multi_package_distribution_; |
223 Version critical_update_version_; | |
214 Level level_; | 224 Level level_; |
215 PackageType package_type_; | 225 PackageType package_type_; |
216 #if defined(OS_WIN) | 226 #if defined(OS_WIN) |
217 HKEY root_key_; | 227 HKEY root_key_; |
218 #endif | 228 #endif |
219 bool msi_; | 229 bool msi_; |
220 bool verbose_logging_; | 230 bool verbose_logging_; |
221 | 231 |
222 private: | 232 private: |
223 DISALLOW_COPY_AND_ASSIGN(InstallerState); | 233 DISALLOW_COPY_AND_ASSIGN(InstallerState); |
224 }; // class InstallerState | 234 }; // class InstallerState |
225 | 235 |
226 } // namespace installer | 236 } // namespace installer |
227 | 237 |
228 #endif // CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ | 238 #endif // CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ |
OLD | NEW |