| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <functional> | 8 #include <functional> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 DCHECK_NE(file_bits, 0U); | 623 DCHECK_NE(file_bits, 0U); |
| 624 DCHECK_LT(file_bits, 1U << NUM_BINARIES); | 624 DCHECK_LT(file_bits, 1U << NUM_BINARIES); |
| 625 COMPILE_ASSERT(CHROME_DLL == 1, no_youre_out_of_order); | 625 COMPILE_ASSERT(CHROME_DLL == 1, no_youre_out_of_order); |
| 626 COMPILE_ASSERT(CHROME_FRAME_DLL == 2, no_youre_out_of_order); | 626 COMPILE_ASSERT(CHROME_FRAME_DLL == 2, no_youre_out_of_order); |
| 627 COMPILE_ASSERT(CHROME_FRAME_HELPER_DLL == 4, no_youre_out_of_order); | 627 COMPILE_ASSERT(CHROME_FRAME_HELPER_DLL == 4, no_youre_out_of_order); |
| 628 COMPILE_ASSERT(CHROME_FRAME_HELPER_EXE == 8, no_youre_out_of_order); | 628 COMPILE_ASSERT(CHROME_FRAME_HELPER_EXE == 8, no_youre_out_of_order); |
| 629 | 629 |
| 630 // Check only for the current version (i.e., the version we are upgrading | 630 // Check only for the current version (i.e., the version we are upgrading |
| 631 // _from_). Later versions from pending in-use updates need not be checked | 631 // _from_). Later versions from pending in-use updates need not be checked |
| 632 // since the current version is guaranteed to be in use if any such are. | 632 // since the current version is guaranteed to be in use if any such are. |
| 633 bool in_use = false; | |
| 634 scoped_ptr<Version> current_version(GetCurrentVersion(machine_state)); | 633 scoped_ptr<Version> current_version(GetCurrentVersion(machine_state)); |
| 635 if (!current_version) | 634 if (!current_version) |
| 636 return false; | 635 return false; |
| 637 base::FilePath directory( | 636 base::FilePath directory( |
| 638 target_path().AppendASCII(current_version->GetString())); | 637 target_path().AppendASCII(current_version->GetString())); |
| 639 for (int i = 0; i < NUM_BINARIES; ++i) { | 638 for (int i = 0; i < NUM_BINARIES; ++i) { |
| 640 if (!(file_bits & (1U << i))) | 639 if (!(file_bits & (1U << i))) |
| 641 continue; | 640 continue; |
| 642 base::FilePath file(directory.Append(kBinaryFileNames[i])); | 641 base::FilePath file(directory.Append(kBinaryFileNames[i])); |
| 643 if (base::PathExists(file) && IsFileInUse(file)) | 642 if (base::PathExists(file) && IsFileInUse(file)) |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 827 } | 826 } |
| 828 if (!install_list->Do()) | 827 if (!install_list->Do()) |
| 829 LOG(ERROR) << "Failed to record installer error information in registry."; | 828 LOG(ERROR) << "Failed to record installer error information in registry."; |
| 830 } | 829 } |
| 831 | 830 |
| 832 bool InstallerState::RequiresActiveSetup() const { | 831 bool InstallerState::RequiresActiveSetup() const { |
| 833 return system_install() && FindProduct(BrowserDistribution::CHROME_BROWSER); | 832 return system_install() && FindProduct(BrowserDistribution::CHROME_BROWSER); |
| 834 } | 833 } |
| 835 | 834 |
| 836 } // namespace installer | 835 } // namespace installer |
| OLD | NEW |