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