Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(65)

Side by Side Diff: chrome/installer/util/installation_state.cc

Issue 6153003: Refactor install.cc into the work item parts and the non-work item parts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: PostMergeTest3AddingMissingFile Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/installer/util/installation_state.h ('k') | chrome/installer/util/installer_state.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « chrome/installer/util/installation_state.h ('k') | chrome/installer/util/installer_state.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698