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 #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/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "base/version.h" | 10 #include "base/version.h" |
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 return false; | 217 return false; |
218 *usagestats = usagestats_; | 218 *usagestats = usagestats_; |
219 return true; | 219 return true; |
220 } | 220 } |
221 | 221 |
222 InstallationState::InstallationState() { | 222 InstallationState::InstallationState() { |
223 } | 223 } |
224 | 224 |
225 // static | 225 // static |
226 int InstallationState::IndexFromDistType(BrowserDistribution::Type type) { | 226 int InstallationState::IndexFromDistType(BrowserDistribution::Type type) { |
227 COMPILE_ASSERT(BrowserDistribution::CHROME_BROWSER == CHROME_BROWSER_INDEX, | 227 static_assert(BrowserDistribution::CHROME_BROWSER == CHROME_BROWSER_INDEX, |
228 unexpected_chrome_browser_distribution_value_); | 228 "unexpected_chrome_browser_distribution_value_"); |
229 COMPILE_ASSERT(BrowserDistribution::CHROME_FRAME == CHROME_FRAME_INDEX, | 229 static_assert(BrowserDistribution::CHROME_FRAME == CHROME_FRAME_INDEX, |
230 unexpected_chrome_frame_distribution_value_); | 230 "unexpected_chrome_frame_distribution_value_"); |
231 COMPILE_ASSERT(BrowserDistribution::CHROME_BINARIES == CHROME_BINARIES_INDEX, | 231 static_assert(BrowserDistribution::CHROME_BINARIES == CHROME_BINARIES_INDEX, |
232 unexpected_chrome_frame_distribution_value_); | 232 "unexpected_chrome_frame_distribution_value_"); |
233 DCHECK(type == BrowserDistribution::CHROME_BROWSER || | 233 DCHECK(type == BrowserDistribution::CHROME_BROWSER || |
234 type == BrowserDistribution::CHROME_FRAME || | 234 type == BrowserDistribution::CHROME_FRAME || |
235 type == BrowserDistribution::CHROME_BINARIES); | 235 type == BrowserDistribution::CHROME_BINARIES); |
236 return type; | 236 return type; |
237 } | 237 } |
238 | 238 |
239 void InstallationState::Initialize() { | 239 void InstallationState::Initialize() { |
240 BrowserDistribution* distribution; | 240 BrowserDistribution* distribution; |
241 | 241 |
242 distribution = BrowserDistribution::GetSpecificDistribution( | 242 distribution = BrowserDistribution::GetSpecificDistribution( |
(...skipping 21 matching lines...) Expand all Loading... |
264 } | 264 } |
265 | 265 |
266 const ProductState* InstallationState::GetProductState( | 266 const ProductState* InstallationState::GetProductState( |
267 bool system_install, | 267 bool system_install, |
268 BrowserDistribution::Type type) const { | 268 BrowserDistribution::Type type) const { |
269 const ProductState* product_state = | 269 const ProductState* product_state = |
270 GetNonVersionedProductState(system_install, type); | 270 GetNonVersionedProductState(system_install, type); |
271 return product_state->version_.get() == NULL ? NULL : product_state; | 271 return product_state->version_.get() == NULL ? NULL : product_state; |
272 } | 272 } |
273 } // namespace installer | 273 } // namespace installer |
OLD | NEW |