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 #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 | 7 |
8 #include <set> | 8 #include <set> |
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/files/file_path.h" | 13 #include "base/files/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/strings/string16.h" |
17 #include "base/version.h" | 18 #include "base/version.h" |
18 #include "chrome/installer/util/browser_distribution.h" | 19 #include "chrome/installer/util/browser_distribution.h" |
19 #include "chrome/installer/util/product.h" | 20 #include "chrome/installer/util/product.h" |
20 #include "chrome/installer/util/util_constants.h" | 21 #include "chrome/installer/util/util_constants.h" |
21 | 22 |
22 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
23 #include <windows.h> // NOLINT | 24 #include <windows.h> // NOLINT |
24 #endif | 25 #endif |
25 | 26 |
26 namespace base { | 27 namespace base { |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // The level (user or system) of this operation. | 101 // The level (user or system) of this operation. |
101 Level level() const { return level_; } | 102 Level level() const { return level_; } |
102 | 103 |
103 // The package type (single or multi) of this operation. | 104 // The package type (single or multi) of this operation. |
104 PackageType package_type() const { return package_type_; } | 105 PackageType package_type() const { return package_type_; } |
105 | 106 |
106 // An identifier of this operation. | 107 // An identifier of this operation. |
107 Operation operation() const { return operation_; } | 108 Operation operation() const { return operation_; } |
108 | 109 |
109 // A convenience method returning level() == SYSTEM_LEVEL. | 110 // A convenience method returning level() == SYSTEM_LEVEL. |
110 // TODO(grt): Eradicate the bool in favor of the enum. | |
111 bool system_install() const; | 111 bool system_install() const; |
112 | 112 |
113 // A convenience method returning package_type() == MULTI_PACKAGE. | 113 // A convenience method returning package_type() == MULTI_PACKAGE. |
114 // TODO(grt): Eradicate the bool in favor of the enum. | |
115 bool is_multi_install() const; | 114 bool is_multi_install() const; |
116 | 115 |
117 // The full path to the place where the operand resides. | 116 // The full path to the place where the operand resides. |
118 const base::FilePath& target_path() const { return target_path_; } | 117 const base::FilePath& target_path() const { return target_path_; } |
119 | 118 |
120 // True if the "msi" preference is set or if a product with the "msi" state | 119 // True if the "msi" preference is set or if a product with the "msi" state |
121 // flag is set is to be operated on. | 120 // flag is set is to be operated on. |
122 bool is_msi() const { return msi_; } | 121 bool is_msi() const { return msi_; } |
123 | 122 |
124 // True if the --verbose-logging command-line flag is set or if the | 123 // True if the --verbose-logging command-line flag is set or if the |
125 // verbose_logging master preferences option is true. | 124 // verbose_logging master preferences option is true. |
126 bool verbose_logging() const { return verbose_logging_; } | 125 bool verbose_logging() const { return verbose_logging_; } |
127 | 126 |
128 #if defined(OS_WIN) | 127 #if defined(OS_WIN) |
129 HKEY root_key() const { return root_key_; } | 128 HKEY root_key() const { return root_key_; } |
130 #endif | 129 #endif |
131 | 130 |
132 // The ClientState key by which we interact with Google Update. | 131 // The ClientState key by which we interact with Google Update. |
133 const std::wstring& state_key() const { return state_key_; } | 132 const base::string16& state_key() const { return state_key_; } |
134 | 133 |
135 // Convenience method to return the type of the BrowserDistribution associated | 134 // Convenience method to return the type of the BrowserDistribution associated |
136 // with the ClientState key we will be interacting with. | 135 // with the ClientState key we will be interacting with. |
137 BrowserDistribution::Type state_type() const { return state_type_; } | 136 BrowserDistribution::Type state_type() const { return state_type_; } |
138 | 137 |
139 // Returns the BrowserDistribution instance corresponding to the binaries for | 138 // Returns the BrowserDistribution instance corresponding to the binaries for |
140 // this run if we're operating on a multi-package product. | 139 // this run if we're operating on a multi-package product. |
141 BrowserDistribution* multi_package_binaries_distribution() const { | 140 BrowserDistribution* multi_package_binaries_distribution() const { |
142 DCHECK(package_type_ == MULTI_PACKAGE); | 141 DCHECK(package_type_ == MULTI_PACKAGE); |
143 DCHECK(multi_package_distribution_ != NULL); | 142 DCHECK(multi_package_distribution_ != NULL); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 | 247 |
249 // Sets this object's level and updates the root_key_ accordingly. | 248 // Sets this object's level and updates the root_key_ accordingly. |
250 void set_level(Level level); | 249 void set_level(Level level); |
251 | 250 |
252 // Sets this object's package type and updates the multi_package_distribution_ | 251 // Sets this object's package type and updates the multi_package_distribution_ |
253 // accordingly. | 252 // accordingly. |
254 void set_package_type(PackageType type); | 253 void set_package_type(PackageType type); |
255 | 254 |
256 Operation operation_; | 255 Operation operation_; |
257 base::FilePath target_path_; | 256 base::FilePath target_path_; |
258 std::wstring state_key_; | 257 base::string16 state_key_; |
259 BrowserDistribution::Type state_type_; | 258 BrowserDistribution::Type state_type_; |
260 ScopedVector<Product> products_; | 259 ScopedVector<Product> products_; |
261 BrowserDistribution* multi_package_distribution_; | 260 BrowserDistribution* multi_package_distribution_; |
262 base::Version critical_update_version_; | 261 base::Version critical_update_version_; |
263 Level level_; | 262 Level level_; |
264 PackageType package_type_; | 263 PackageType package_type_; |
265 #if defined(OS_WIN) | 264 #if defined(OS_WIN) |
266 HKEY root_key_; | 265 HKEY root_key_; |
267 #endif | 266 #endif |
268 bool msi_; | 267 bool msi_; |
269 bool verbose_logging_; | 268 bool verbose_logging_; |
270 | 269 |
271 private: | 270 private: |
272 DISALLOW_COPY_AND_ASSIGN(InstallerState); | 271 DISALLOW_COPY_AND_ASSIGN(InstallerState); |
273 }; // class InstallerState | 272 }; // class InstallerState |
274 | 273 |
275 } // namespace installer | 274 } // namespace installer |
276 | 275 |
277 #endif // CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ | 276 #endif // CHROME_INSTALLER_UTIL_INSTALLER_STATE_H_ |
OLD | NEW |