| 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 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 } | 545 } |
| 546 const ProductState* product_state = | 546 const ProductState* product_state = |
| 547 machine_state.GetProductState(level_ == SYSTEM_LEVEL, prod_type); | 547 machine_state.GetProductState(level_ == SYSTEM_LEVEL, prod_type); |
| 548 | 548 |
| 549 if (product_state != NULL) { | 549 if (product_state != NULL) { |
| 550 const Version* version = NULL; | 550 const Version* version = NULL; |
| 551 | 551 |
| 552 // Be aware that there might be a pending "new_chrome.exe" already in the | 552 // Be aware that there might be a pending "new_chrome.exe" already in the |
| 553 // installation path. If so, we use old_version, which holds the version of | 553 // installation path. If so, we use old_version, which holds the version of |
| 554 // "chrome.exe" itself. | 554 // "chrome.exe" itself. |
| 555 if (file_util::PathExists(target_path().Append(kChromeNewExe))) | 555 if (base::PathExists(target_path().Append(kChromeNewExe))) |
| 556 version = product_state->old_version(); | 556 version = product_state->old_version(); |
| 557 | 557 |
| 558 if (version == NULL) | 558 if (version == NULL) |
| 559 version = &product_state->version(); | 559 version = &product_state->version(); |
| 560 | 560 |
| 561 current_version.reset(new Version(*version)); | 561 current_version.reset(new Version(*version)); |
| 562 } | 562 } |
| 563 | 563 |
| 564 return current_version.release(); | 564 return current_version.release(); |
| 565 } | 565 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 583 // We check only for the current version (e.g. the version we are upgrading | 583 // We check only for the current version (e.g. the version we are upgrading |
| 584 // _from_). We don't need to check interstitial versions if any (as would | 584 // _from_). We don't need to check interstitial versions if any (as would |
| 585 // occur in the case of multiple updates) since if they are in use, we are | 585 // occur in the case of multiple updates) since if they are in use, we are |
| 586 // guaranteed that the current version is in use too. | 586 // guaranteed that the current version is in use too. |
| 587 bool in_use = false; | 587 bool in_use = false; |
| 588 scoped_ptr<Version> current_version(GetCurrentVersion(machine_state)); | 588 scoped_ptr<Version> current_version(GetCurrentVersion(machine_state)); |
| 589 if (current_version != NULL) { | 589 if (current_version != NULL) { |
| 590 base::FilePath cf_install_path( | 590 base::FilePath cf_install_path( |
| 591 target_path().AppendASCII(current_version->GetString()) | 591 target_path().AppendASCII(current_version->GetString()) |
| 592 .Append(kChromeFrameDll)); | 592 .Append(kChromeFrameDll)); |
| 593 in_use = file_util::PathExists(cf_install_path) && | 593 in_use = base::PathExists(cf_install_path) && |
| 594 IsFileInUse(cf_install_path); | 594 IsFileInUse(cf_install_path); |
| 595 } | 595 } |
| 596 return in_use; | 596 return in_use; |
| 597 } | 597 } |
| 598 | 598 |
| 599 base::FilePath InstallerState::GetInstallerDirectory( | 599 base::FilePath InstallerState::GetInstallerDirectory( |
| 600 const Version& version) const { | 600 const Version& version) const { |
| 601 return target_path().Append(ASCIIToWide(version.GetString())) | 601 return target_path().Append(ASCIIToWide(version.GetString())) |
| 602 .Append(kInstallerDir); | 602 .Append(kInstallerDir); |
| 603 } | 603 } |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 791 } | 791 } |
| 792 if (!install_list->Do()) | 792 if (!install_list->Do()) |
| 793 LOG(ERROR) << "Failed to record installer error information in registry."; | 793 LOG(ERROR) << "Failed to record installer error information in registry."; |
| 794 } | 794 } |
| 795 | 795 |
| 796 bool InstallerState::RequiresActiveSetup() const { | 796 bool InstallerState::RequiresActiveSetup() const { |
| 797 return system_install() && FindProduct(BrowserDistribution::CHROME_BROWSER); | 797 return system_install() && FindProduct(BrowserDistribution::CHROME_BROWSER); |
| 798 } | 798 } |
| 799 | 799 |
| 800 } // namespace installer | 800 } // namespace installer |
| OLD | NEW |