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/installer_state.h" | 5 #include "chrome/installer/util/installer_state.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include <algorithm> | 9 #include <algorithm> |
8 #include <functional> | 10 #include <functional> |
9 #include <utility> | 11 #include <utility> |
10 | 12 |
11 #include "base/command_line.h" | 13 #include "base/command_line.h" |
12 #include "base/file_version_info.h" | 14 #include "base/file_version_info.h" |
13 #include "base/files/file_enumerator.h" | 15 #include "base/files/file_enumerator.h" |
14 #include "base/files/file_util.h" | 16 #include "base/files/file_util.h" |
15 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/macros.h" |
16 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/scoped_ptr.h" |
17 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
18 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
19 #include "base/win/registry.h" | 22 #include "base/win/registry.h" |
20 #include "base/win/scoped_handle.h" | 23 #include "base/win/scoped_handle.h" |
21 #include "chrome/installer/util/delete_tree_work_item.h" | 24 #include "chrome/installer/util/delete_tree_work_item.h" |
22 #include "chrome/installer/util/helper.h" | 25 #include "chrome/installer/util/helper.h" |
23 #include "chrome/installer/util/install_util.h" | 26 #include "chrome/installer/util/install_util.h" |
24 #include "chrome/installer/util/installation_state.h" | 27 #include "chrome/installer/util/installation_state.h" |
25 #include "chrome/installer/util/master_preferences.h" | 28 #include "chrome/installer/util/master_preferences.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
468 products_.clear(); | 471 products_.clear(); |
469 multi_package_distribution_ = NULL; | 472 multi_package_distribution_ = NULL; |
470 critical_update_version_ = base::Version(); | 473 critical_update_version_ = base::Version(); |
471 level_ = UNKNOWN_LEVEL; | 474 level_ = UNKNOWN_LEVEL; |
472 package_type_ = UNKNOWN_PACKAGE_TYPE; | 475 package_type_ = UNKNOWN_PACKAGE_TYPE; |
473 root_key_ = NULL; | 476 root_key_ = NULL; |
474 msi_ = false; | 477 msi_ = false; |
475 verbose_logging_ = false; | 478 verbose_logging_ = false; |
476 } | 479 } |
477 | 480 |
478 bool InstallerState::AnyExistsAndIsInUse( | 481 bool InstallerState::AnyExistsAndIsInUse(const InstallationState& machine_state, |
479 const InstallationState& machine_state, | 482 uint32_t file_bits) const { |
480 uint32 file_bits) const { | |
481 static const wchar_t* const kBinaryFileNames[] = { | 483 static const wchar_t* const kBinaryFileNames[] = { |
482 kChromeDll, | 484 kChromeDll, |
483 kChromeFrameDll, | 485 kChromeFrameDll, |
484 kChromeFrameHelperDll, | 486 kChromeFrameHelperDll, |
485 kChromeFrameHelperExe, | 487 kChromeFrameHelperExe, |
486 }; | 488 }; |
487 DCHECK_NE(file_bits, 0U); | 489 DCHECK_NE(file_bits, 0U); |
488 DCHECK_LT(file_bits, 1U << NUM_BINARIES); | 490 DCHECK_LT(file_bits, 1U << NUM_BINARIES); |
489 static_assert(CHROME_DLL == 1, "binary file names and values must match"); | 491 static_assert(CHROME_DLL == 1, "binary file names and values must match"); |
490 static_assert(CHROME_FRAME_DLL == 2, | 492 static_assert(CHROME_FRAME_DLL == 2, |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
688 } | 690 } |
689 if (!install_list->Do()) | 691 if (!install_list->Do()) |
690 LOG(ERROR) << "Failed to record installer error information in registry."; | 692 LOG(ERROR) << "Failed to record installer error information in registry."; |
691 } | 693 } |
692 | 694 |
693 bool InstallerState::RequiresActiveSetup() const { | 695 bool InstallerState::RequiresActiveSetup() const { |
694 return system_install() && FindProduct(BrowserDistribution::CHROME_BROWSER); | 696 return system_install() && FindProduct(BrowserDistribution::CHROME_BROWSER); |
695 } | 697 } |
696 | 698 |
697 } // namespace installer | 699 } // namespace installer |
OLD | NEW |