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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 return false; | 214 return false; |
215 *usagestats = usagestats_; | 215 *usagestats = usagestats_; |
216 return true; | 216 return true; |
217 } | 217 } |
218 | 218 |
219 InstallationState::InstallationState() { | 219 InstallationState::InstallationState() { |
220 } | 220 } |
221 | 221 |
222 // static | 222 // static |
223 int InstallationState::IndexFromDistType(BrowserDistribution::Type type) { | 223 int InstallationState::IndexFromDistType(BrowserDistribution::Type type) { |
224 COMPILE_ASSERT(BrowserDistribution::CHROME_BROWSER == CHROME_BROWSER_INDEX, | 224 static_assert(BrowserDistribution::CHROME_BROWSER == CHROME_BROWSER_INDEX, |
225 unexpected_chrome_browser_distribution_value_); | 225 "unexpected chrome browser distribution value"); |
226 COMPILE_ASSERT(BrowserDistribution::CHROME_FRAME == CHROME_FRAME_INDEX, | 226 static_assert(BrowserDistribution::CHROME_FRAME == CHROME_FRAME_INDEX, |
227 unexpected_chrome_frame_distribution_value_); | 227 "unexpected chrome frame distribution value"); |
228 COMPILE_ASSERT(BrowserDistribution::CHROME_BINARIES == CHROME_BINARIES_INDEX, | 228 static_assert(BrowserDistribution::CHROME_BINARIES == CHROME_BINARIES_INDEX, |
229 unexpected_chrome_frame_distribution_value_); | 229 "unexpected chrome binaries distribution value"); |
230 COMPILE_ASSERT(BrowserDistribution::CHROME_APP_HOST == CHROME_APP_HOST_INDEX, | 230 static_assert(BrowserDistribution::CHROME_APP_HOST == CHROME_APP_HOST_INDEX, |
231 unexpected_chrome_frame_distribution_value_); | 231 "unexpected chrome app host distribution value"); |
232 DCHECK(type == BrowserDistribution::CHROME_BROWSER || | 232 DCHECK(type == BrowserDistribution::CHROME_BROWSER || |
233 type == BrowserDistribution::CHROME_FRAME || | 233 type == BrowserDistribution::CHROME_FRAME || |
234 type == BrowserDistribution::CHROME_BINARIES || | 234 type == BrowserDistribution::CHROME_BINARIES || |
235 type == BrowserDistribution::CHROME_APP_HOST); | 235 type == BrowserDistribution::CHROME_APP_HOST); |
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 |
(...skipping 27 matching lines...) Expand all Loading... |
269 } | 269 } |
270 | 270 |
271 const ProductState* InstallationState::GetProductState( | 271 const ProductState* InstallationState::GetProductState( |
272 bool system_install, | 272 bool system_install, |
273 BrowserDistribution::Type type) const { | 273 BrowserDistribution::Type type) const { |
274 const ProductState* product_state = | 274 const ProductState* product_state = |
275 GetNonVersionedProductState(system_install, type); | 275 GetNonVersionedProductState(system_install, type); |
276 return product_state->version_.get() == NULL ? NULL : product_state; | 276 return product_state->version_.get() == NULL ? NULL : product_state; |
277 } | 277 } |
278 } // namespace installer | 278 } // namespace installer |
OLD | NEW |