| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/installer/util/installation_state.h" | 5 #include "chrome/installer/util/installation_state.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/version.h" | 9 #include "base/version.h" |
| 10 #include "base/win/registry.h" | 10 #include "base/win/registry.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 properties.GetStateKey()); | 101 properties.GetStateKey()); |
| 102 } | 102 } |
| 103 | 103 |
| 104 const ProductState* InstallationState::GetMultiPackageState( | 104 const ProductState* InstallationState::GetMultiPackageState( |
| 105 bool system_install) const { | 105 bool system_install) const { |
| 106 const ProductState& product_state = | 106 const ProductState& product_state = |
| 107 (system_install ? system_products_ : user_products_)[MULTI_PACKAGE_INDEX]; | 107 (system_install ? system_products_ : user_products_)[MULTI_PACKAGE_INDEX]; |
| 108 return product_state.version_.get() == NULL ? NULL : &product_state; | 108 return product_state.version_.get() == NULL ? NULL : &product_state; |
| 109 } | 109 } |
| 110 | 110 |
| 111 // Included for testing. | |
| 112 void InstallationState::SetMultiPackageState(bool system_install, | |
| 113 const ProductState& package_state) { | |
| 114 ProductState& target = | |
| 115 (system_install ? system_products_ : user_products_)[MULTI_PACKAGE_INDEX]; | |
| 116 target.CopyFrom(package_state); | |
| 117 } | |
| 118 | |
| 119 const ProductState* InstallationState::GetProductState( | 111 const ProductState* InstallationState::GetProductState( |
| 120 bool system_install, | 112 bool system_install, |
| 121 BrowserDistribution::Type type) const { | 113 BrowserDistribution::Type type) const { |
| 122 const ProductState& product_state = (system_install ? system_products_ : | 114 const ProductState& product_state = (system_install ? system_products_ : |
| 123 user_products_)[IndexFromDistType(type)]; | 115 user_products_)[IndexFromDistType(type)]; |
| 124 return product_state.version_.get() == NULL ? NULL : &product_state; | 116 return product_state.version_.get() == NULL ? NULL : &product_state; |
| 125 } | 117 } |
| 126 | 118 |
| 127 // Included for testing. | |
| 128 void InstallationState::SetProductState(bool system_install, | |
| 129 BrowserDistribution::Type type, const ProductState& product_state) { | |
| 130 ProductState& target = (system_install ? system_products_ : | |
| 131 user_products_)[IndexFromDistType(type)]; | |
| 132 target.CopyFrom(product_state); | |
| 133 } | |
| 134 | |
| 135 } // namespace installer | 119 } // namespace installer |
| OLD | NEW |