diff --git a/chrome/chrome_installer.gypi b/chrome/chrome_installer.gypi index 02eaf116d927dc..7a696c85ced4af 100644 --- a/chrome/chrome_installer.gypi +++ b/chrome/chrome_installer.gypi @@ -275,8 +275,6 @@ 'installer/setup/archive_patch_helper.h', 'installer/setup/cf_migration.cc', 'installer/setup/cf_migration.h', - 'installer/setup/chrome_frame_quick_enable.cc', - 'installer/setup/chrome_frame_quick_enable.h', 'installer/setup/install.cc', 'installer/setup/install.h', 'installer/setup/install_worker.cc', diff --git a/chrome/installer/setup/chrome_frame_quick_enable.cc b/chrome/installer/setup/chrome_frame_quick_enable.cc deleted file mode 100644 index 9ae7a317fdc6d4..00000000000000 --- a/chrome/installer/setup/chrome_frame_quick_enable.cc +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/installer/setup/chrome_frame_quick_enable.h" - -#include - -#include "base/files/scoped_temp_dir.h" -#include "base/logging.h" -#include "base/strings/string_util.h" -#include "base/win/registry.h" -#include "chrome/installer/setup/install_worker.h" -#include "chrome/installer/util/google_update_constants.h" -#include "chrome/installer/util/google_update_settings.h" -#include "chrome/installer/util/install_util.h" -#include "chrome/installer/util/installation_state.h" -#include "chrome/installer/util/installer_state.h" -#include "chrome/installer/util/product.h" -#include "chrome/installer/util/work_item.h" -#include "chrome/installer/util/work_item_list.h" - -using base::win::RegKey; - -namespace installer { - -namespace { - -InstallStatus CheckQuickEnablePreconditions( - const InstallationState& machine_state, - const InstallerState& installer_state) { - // Make sure Chrome is multi-installed. - const ProductState* chrome_state = - machine_state.GetProductState(installer_state.system_install(), - BrowserDistribution::CHROME_BROWSER); - if (chrome_state == NULL) { - LOG(ERROR) << "Chrome Frame quick enable requires Chrome to be installed."; - return CHROME_NOT_INSTALLED; - } else if (!chrome_state->is_multi_install()) { - LOG(ERROR) << "Chrome Frame quick enable requires multi-install of Chrome."; - return NON_MULTI_INSTALLATION_EXISTS; - } - - // Chrome Frame must not be installed. - const ProductState* cf_state = - machine_state.GetProductState(installer_state.system_install(), - BrowserDistribution::CHROME_FRAME); - // Make sure we check both user and system installations. - if (!cf_state) { - cf_state = machine_state.GetProductState(!installer_state.system_install(), - BrowserDistribution::CHROME_FRAME); - } - - if (cf_state != NULL) { - LOG(ERROR) << "Chrome Frame already installed."; - return installer_state.system_install() ? - SYSTEM_LEVEL_INSTALL_EXISTS : USER_LEVEL_INSTALL_EXISTS; - } - - return FIRST_INSTALL_SUCCESS; -} - -} // end namespace - -InstallStatus ChromeFrameQuickEnable(const InstallationState& machine_state, - InstallerState* installer_state) { - DCHECK(installer_state); - VLOG(1) << "Chrome Frame Quick Enable"; - InstallStatus status = CheckQuickEnablePreconditions(machine_state, - *installer_state); - - if (status == FIRST_INSTALL_SUCCESS) { - scoped_ptr multi_cf(new Product( - BrowserDistribution::GetSpecificDistribution( - BrowserDistribution::CHROME_FRAME))); - multi_cf->SetOption(installer::kOptionMultiInstall, true); - Product* cf = installer_state->AddProduct(&multi_cf); - if (!cf) { - LOG(ERROR) << "AddProduct failed"; - status = INSTALL_FAILED; - } else { - base::ScopedTempDir temp_path; - if (!temp_path.CreateUniqueTempDir()) { - PLOG(ERROR) << "Failed to create Temp directory"; - return INSTALL_FAILED; - } - scoped_ptr item_list(WorkItem::CreateWorkItemList()); - const ProductState* chrome_state = - machine_state.GetProductState(installer_state->system_install(), - BrowserDistribution::CHROME_BROWSER); - DCHECK(chrome_state); // Checked in CheckQuickEnablePreconditions. - - // Temporarily remove Chrome from the product list. - // This is so that the operations below do not affect the installation - // state of Chrome. - installer_state->RemoveProduct( - installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER)); - - base::FilePath setup_path(chrome_state->GetSetupPath()); - const Version& new_version = chrome_state->version(); - - // This creates the uninstallation entry for GCF. - AddUninstallShortcutWorkItems(*installer_state, setup_path, new_version, - *cf, item_list.get()); - // Always set the "lang" value since quick-enable always happens in the - // context of an interactive session with a user. - AddVersionKeyWorkItems(installer_state->root_key(), cf->distribution(), - new_version, true, item_list.get()); - - const Version* opv = chrome_state->old_version(); - AppendPostInstallTasks(*installer_state, setup_path, opv, - new_version, temp_path.path(), item_list.get()); - - // Before updating the channel values, add Chrome back to the mix so that - // all multi-installed products' channel values get updated. - installer_state->AddProductFromState(BrowserDistribution::CHROME_BROWSER, - *chrome_state); - AddGoogleUpdateWorkItems(machine_state, *installer_state, - item_list.get()); - - // Add the items to remove the quick-enable-cf command from the registry. - AddQuickEnableChromeFrameWorkItems( - *installer_state, machine_state, - chrome_state->uninstall_command().GetProgram(), - new_version, - item_list.get()); - - if (!item_list->Do()) { - item_list->Rollback(); - status = INSTALL_FAILED; - } else { - DCHECK_EQ(FIRST_INSTALL_SUCCESS, status); - VLOG(1) << "Chrome Frame successfully activated."; - } - } - } - - // If quick-enable succeeded, check to see if the EULA has not yet been - // accepted for the binaries. If this is the case, we must also flip the - // eulaaccepted bit for them. Otherwise, Google Update would not update - // Chrome Frame, and that would be bad. Don't flip the EULA bit for Chrome - // itself, as it will show the EULA on first-run and mark its acceptance - // accordingly. - if (!InstallUtil::GetInstallReturnCode(status)) { - const bool system_level = installer_state->system_install(); - const ProductState* binaries = - machine_state.GetProductState(system_level, - BrowserDistribution::CHROME_BINARIES); - DCHECK(binaries); - DWORD eula_accepted; - - if (binaries != NULL && - binaries->GetEulaAccepted(&eula_accepted) && - eula_accepted == 0 && - !GoogleUpdateSettings::SetEULAConsent( - machine_state, - BrowserDistribution::GetSpecificDistribution( - BrowserDistribution::CHROME_BINARIES), - true)) { - LOG(ERROR) << "Failed to set EULA consent for multi-install binaries."; - } - } - - return status; -} - -} // namespace installer diff --git a/chrome/installer/setup/chrome_frame_quick_enable.h b/chrome/installer/setup/chrome_frame_quick_enable.h deleted file mode 100644 index 60a44b6785379a..00000000000000 --- a/chrome/installer/setup/chrome_frame_quick_enable.h +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -// Support for Chrome Frame quick enable. - -#ifndef CHROME_INSTALLER_SETUP_CHROME_FRAME_QUICK_ENABLE_H_ -#define CHROME_INSTALLER_SETUP_CHROME_FRAME_QUICK_ENABLE_H_ - -#include "chrome/installer/util/util_constants.h" - -namespace installer { - -class InstallationState; -class InstallerState; - -// Installs Chrome Frame in the same location as Chrome is currently installed -// in. Setup is assumed to be running from the Installer directory. -InstallStatus ChromeFrameQuickEnable(const InstallationState& machine_state, - InstallerState* installer_state); - -} // namespace installer - -#endif // CHROME_INSTALLER_SETUP_CHROME_FRAME_QUICK_ENABLE_H_ diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc index e15e8c5cb4f0f2..94b5fbefece1b8 100644 --- a/chrome/installer/setup/install_worker.cc +++ b/chrome/installer/setup/install_worker.cc @@ -393,8 +393,7 @@ void AddProductSpecificWorkItems(const InstallationState& original_state, if (p.is_chrome_binaries()) { AddQueryEULAAcceptanceWorkItems( installer_state, setup_path, new_version, p, list); - AddQuickEnableChromeFrameWorkItems( - installer_state, original_state, setup_path, new_version, list); + AddQuickEnableChromeFrameWorkItems(installer_state, list); AddQuickEnableApplicationLauncherWorkItems( installer_state, original_state, setup_path, new_version, list); } @@ -1512,50 +1511,21 @@ void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, } void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state, - const InstallationState& machine_state, - const base::FilePath& setup_path, - const Version& new_version, WorkItemList* work_item_list) { DCHECK(work_item_list); - const bool system_install = installer_state.system_install(); - bool will_have_chrome_frame = - WillProductBePresentAfterSetup(installer_state, machine_state, - BrowserDistribution::CHROME_FRAME); - bool will_have_chrome_binaries = - WillProductBePresentAfterSetup(installer_state, machine_state, - BrowserDistribution::CHROME_BINARIES); - string16 cmd_key(GetRegCommandKey( BrowserDistribution::GetSpecificDistribution( BrowserDistribution::CHROME_BINARIES), kCmdQuickEnableCf)); - if (will_have_chrome_frame) { - // Chrome Frame is (to be) installed. Unconditionally remove the Quick - // Enable command from the binaries. We do this even if multi-install Chrome - // isn't installed since we don't want them left behind in any case. - work_item_list->AddDeleteRegKeyWorkItem( - installer_state.root_key(), cmd_key)->set_log_message( - "removing " + WideToASCII(kCmdQuickEnableCf) + " command"); + // Unconditionally remove the legacy Quick Enable command from the binaries. + // Do this even if multi-install Chrome isn't installed to ensure that it is + // not left behind in any case. + work_item_list->AddDeleteRegKeyWorkItem( + installer_state.root_key(), cmd_key)->set_log_message( + "removing " + WideToASCII(kCmdQuickEnableCf) + " command"); - } else if (will_have_chrome_binaries) { - // Chrome Frame isn't (to be) installed while some other multi-install - // product is (to be) installed. Add the Quick Enable command to - // the binaries. - CommandLine cmd_line(GetGenericQuickEnableCommand(installer_state, - machine_state, - setup_path, - new_version)); - // kMultiInstall and kVerboseLogging were processed above. - cmd_line.AppendSwitch(switches::kChromeFrameQuickEnable); - if (installer_state.system_install()) - cmd_line.AppendSwitch(switches::kSystemLevel); - AppCommand cmd(cmd_line.GetCommandLineString()); - cmd.set_sends_pings(true); - cmd.set_is_web_accessible(true); - cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list); - } } } // namespace installer diff --git a/chrome/installer/setup/install_worker.h b/chrome/installer/setup/install_worker.h index b3ccbeb2e0b62a..33117dc6ea2e6c 100644 --- a/chrome/installer/setup/install_worker.h +++ b/chrome/installer/setup/install_worker.h @@ -190,17 +190,9 @@ void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, const Product& product, WorkItemList* work_item_list); -// Adds work items to add or remove the "quick-enable-cf" to the multi-installer -// binaries' version key on the basis of the current operation (represented in -// |installer_state|) and the pre-existing machine configuration (represented in -// |machine_state|). |setup_path| (the path to the executable currently being -// run) and |new_version| (the version of the product(s) currently being -// installed) are required when processing product installation; they are unused -// (and may therefore be empty) when uninstalling. +// Adds work items to remove "quick-enable-cf" from the multi-installer +// binaries' version key. void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state, - const InstallationState& machine_state, - const base::FilePath& setup_path, - const base::Version& new_version, WorkItemList* work_item_list); } // namespace installer diff --git a/chrome/installer/setup/install_worker_unittest.cc b/chrome/installer/setup/install_worker_unittest.cc index a9d3a9eb58adbe..81db6032790467 100644 --- a/chrome/installer/setup/install_worker_unittest.cc +++ b/chrome/installer/setup/install_worker_unittest.cc @@ -713,179 +713,10 @@ const wchar_t QuickEnableAbsentTest::kRegKeyPath[] = TEST_F(QuickEnableAbsentTest, CleanInstallSingleChrome) { // Install single Chrome on a clean system. - scoped_ptr installer_state( - BuildChromeInstallerState(system_level_, false, *machine_state_, - InstallerState::SINGLE_INSTALL_OR_UPDATE)); - AddQuickEnableChromeFrameWorkItems(*installer_state, - *machine_state_, - setup_path_, - *new_version_.get(), - &work_item_list_); -} - -TEST_F(QuickEnableAbsentTest, CleanInstallSingleChromeFrame) { - // Install single Chrome Frame on a clean system. - scoped_ptr installer_state( - BuildChromeFrameInstallerState(system_level_, false, *machine_state_, - InstallerState::SINGLE_INSTALL_OR_UPDATE)); - AddQuickEnableChromeFrameWorkItems(*installer_state, - *machine_state_, - setup_path_, - *new_version_.get(), - &work_item_list_); -} - -TEST_F(QuickEnableAbsentTest, CleanInstallMultiChromeFrame) { - // Install multi Chrome Frame on a clean system. - scoped_ptr installer_state( - BuildChromeFrameInstallerState(system_level_, true, *machine_state_, - InstallerState::MULTI_INSTALL)); - AddQuickEnableChromeFrameWorkItems(*installer_state, - *machine_state_, - setup_path_, - *new_version_.get(), - &work_item_list_); -} - -TEST_F(QuickEnableAbsentTest, CleanInstallMultiChromeChromeFrame) { - // Install multi Chrome and Chrome Frame on a clean system. - scoped_ptr installer_state( - BuildBasicInstallerState(system_level_, true, *machine_state_, - InstallerState::MULTI_INSTALL)); - AddChromeBinariesToInstallerState(*machine_state_, installer_state.get()); - AddChromeToInstallerState(*machine_state_, installer_state.get()); - AddChromeFrameToInstallerState(*machine_state_, installer_state.get()); - AddQuickEnableChromeFrameWorkItems(*installer_state, - *machine_state_, - setup_path_, - *new_version_.get(), - &work_item_list_); -} - -TEST_F(QuickEnableAbsentTest, UninstallMultiChromeLeaveMultiChromeFrame) { - // Uninstall multi Chrome on a machine with multi Chrome Frame. - AddChromeToInstallationState(system_level_, true, machine_state_.get()); - AddChromeFrameToInstallationState(system_level_, true, machine_state_.get()); - scoped_ptr installer_state( - BuildBasicInstallerState(system_level_, true, *machine_state_, - InstallerState::UNINSTALL)); - AddChromeToInstallerState(*machine_state_, installer_state.get()); - AddQuickEnableChromeFrameWorkItems(*installer_state, - *machine_state_, - setup_path_, - *new_version_.get(), - &work_item_list_); -} - -TEST_F(QuickEnableAbsentTest, UninstallMultiChromeLeaveSingleChromeFrame) { - // Uninstall multi Chrome on a machine with single Chrome Frame. - AddChromeToInstallationState(system_level_, true, machine_state_.get()); - AddChromeFrameToInstallationState(system_level_, false, machine_state_.get()); - scoped_ptr installer_state( - BuildBasicInstallerState(system_level_, true, *machine_state_, - InstallerState::UNINSTALL)); - AddChromeToInstallerState(*machine_state_, installer_state.get()); - AddChromeBinariesToInstallerState(*machine_state_, installer_state.get()); - AddQuickEnableChromeFrameWorkItems(*installer_state, - *machine_state_, - setup_path_, - *new_version_.get(), - &work_item_list_); -} - -// Test scenarios under which the quick-enable-cf command should exist after the -// run. -class QuickEnablePresentTest : public InstallWorkerTest { - public: - virtual void SetUp() { - InstallWorkerTest::SetUp(); - root_key_ = system_level_ ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; - create_reg_key_work_item_.reset( - WorkItem::CreateCreateRegKeyWorkItem(root_key_, kRegKeyPath)); - set_reg_value_work_item_.reset( - WorkItem::CreateSetRegValueWorkItem(root_key_, kRegKeyPath, L"", L"", - false)); - machine_state_.reset(new MockInstallationState()); - EXPECT_CALL(work_item_list_, - AddCreateRegKeyWorkItem(Eq(root_key_), StrCaseEq(kRegKeyPath))) - .Times(1) - .WillOnce(Return(create_reg_key_work_item_.get())); - EXPECT_CALL(work_item_list_, - AddSetRegStringValueWorkItem(Eq(root_key_), - StrCaseEq(kRegKeyPath), - StrEq(L"CommandLine"), _, - Eq(true))) - .Times(1) - .WillOnce(Return(set_reg_value_work_item_.get())); - EXPECT_CALL(work_item_list_, - AddSetRegDwordValueWorkItem(Eq(root_key_), - StrCaseEq(kRegKeyPath), _, - Eq(static_cast(1)), - Eq(true))) - .Times(2) - .WillRepeatedly(Return(set_reg_value_work_item_.get())); - } - virtual void TearDown() { - machine_state_.reset(); - set_reg_value_work_item_.reset(); - create_reg_key_work_item_.reset(); - root_key_ = NULL; - InstallWorkerTest::TearDown(); - } - protected: - static const bool system_level_ = false; - static const wchar_t kRegKeyPath[]; - HKEY root_key_; - scoped_ptr create_reg_key_work_item_; - scoped_ptr set_reg_value_work_item_; - scoped_ptr machine_state_; - StrictMock work_item_list_; -}; - -const wchar_t QuickEnablePresentTest::kRegKeyPath[] = - L"Software\\Google\\Update\\Clients\\" - L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}\\Commands\\quick-enable-cf"; - -TEST_F(QuickEnablePresentTest, CleanInstallMultiChrome) { - // Install multi Chrome on a clean system. - scoped_ptr installer_state( - BuildChromeInstallerState(system_level_, true, *machine_state_, - InstallerState::MULTI_INSTALL)); - AddQuickEnableChromeFrameWorkItems(*installer_state, - *machine_state_, - setup_path_, - *new_version_.get(), - &work_item_list_); -} - -TEST_F(QuickEnablePresentTest, UninstallSingleChromeFrame) { - // Uninstall single Chrome Frame on a machine with multi Chrome. - AddChromeToInstallationState(system_level_, true, machine_state_.get()); - AddChromeFrameToInstallationState(system_level_, false, machine_state_.get()); - scoped_ptr installer_state( - BuildBasicInstallerState(system_level_, false, *machine_state_, - InstallerState::UNINSTALL)); - AddChromeFrameToInstallerState(*machine_state_, installer_state.get()); - AddQuickEnableChromeFrameWorkItems(*installer_state, - *machine_state_, - setup_path_, - *new_version_.get(), - &work_item_list_); -} - -TEST_F(QuickEnablePresentTest, UninstallMultiChromeFrame) { - // Uninstall multi Chrome Frame on a machine with multi Chrome. - AddChromeToInstallationState(system_level_, true, machine_state_.get()); - AddChromeFrameToInstallationState(system_level_, true, machine_state_.get()); scoped_ptr installer_state( BuildBasicInstallerState(system_level_, true, *machine_state_, - InstallerState::UNINSTALL)); - AddChromeFrameToInstallerState(*machine_state_, installer_state.get()); - AddQuickEnableChromeFrameWorkItems(*installer_state, - *machine_state_, - setup_path_, - *new_version_.get(), - &work_item_list_); + InstallerState::MULTI_UPDATE)); + AddQuickEnableChromeFrameWorkItems(*installer_state, &work_item_list_); } TEST_F(InstallWorkerTest, WillProductBePresentAfterSetup) { diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index 18be39aaed68c1..0f8084c58f764d 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -37,7 +37,6 @@ #include "chrome/common/chrome_switches.h" #include "chrome/installer/setup/archive_patch_helper.h" #include "chrome/installer/setup/cf_migration.h" -#include "chrome/installer/setup/chrome_frame_quick_enable.h" #include "chrome/installer/setup/install.h" #include "chrome/installer/setup/install_worker.h" #include "chrome/installer/setup/setup_constants.h" @@ -1212,9 +1211,6 @@ bool HandleNonInstallCmdLineOptions(const InstallationState& original_state, cmd_line.GetProgram(), installer::REENTRY_SYS_UPDATE, true); } } - } else if (cmd_line.HasSwitch(installer::switches::kChromeFrameQuickEnable)) { - *exit_code = installer::ChromeFrameQuickEnable(original_state, - installer_state); } else if (cmd_line.HasSwitch(installer::switches::kPatch)) { const std::string patch_type_str( cmd_line.GetSwitchValueASCII(installer::switches::kPatch)); @@ -1775,8 +1771,7 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, cmd_line.HasSwitch(installer::switches::kRegisterChromeBrowser) || cmd_line.HasSwitch(installer::switches::kRemoveChromeRegistration) || cmd_line.HasSwitch(installer::switches::kInactiveUserToast) || - cmd_line.HasSwitch(installer::switches::kSystemLevelToast) || - cmd_line.HasSwitch(installer::switches::kChromeFrameQuickEnable)) { + cmd_line.HasSwitch(installer::switches::kSystemLevelToast)) { return installer::SXS_OPTION_NOT_SUPPORTED; } } diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index 5e1693ade46f61..cb5409b7b8835e 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -160,22 +160,6 @@ void ProcessOnOsUpgradeWorkItems( LOG(ERROR) << "Failed to remove on-os-upgrade command."; } -// Adds or removes the quick-enable-cf command to the binaries' version key in -// the registry as needed. -void ProcessQuickEnableWorkItems( - const installer::InstallerState& installer_state, - const installer::InstallationState& machine_state) { - scoped_ptr work_item_list( - WorkItem::CreateNoRollbackWorkItemList()); - - AddQuickEnableChromeFrameWorkItems(installer_state, machine_state, - base::FilePath(), - Version(), work_item_list.get()); - - if (!work_item_list->Do()) - LOG(ERROR) << "Failed to update quick-enable-cf command."; -} - void ProcessIELowRightsPolicyWorkItems( const installer::InstallerState& installer_state) { scoped_ptr work_items(WorkItem::CreateNoRollbackWorkItemList()); @@ -1265,12 +1249,9 @@ InstallStatus UninstallProduct(const InstallationState& original_state, } } - if (installer_state.is_multi_install()) { + if (installer_state.is_multi_install()) ProcessGoogleUpdateItems(original_state, installer_state, product); - ProcessQuickEnableWorkItems(installer_state, original_state); - } - // Get the state of the installed product (if any) const ProductState* product_state = original_state.GetProductState(installer_state.system_install(), diff --git a/chrome/installer/util/installation_validator.cc b/chrome/installer/util/installation_validator.cc index 87fb66eb8d7540..9123ca4b9dea5e 100644 --- a/chrome/installer/util/installation_validator.cc +++ b/chrome/installer/util/installation_validator.cc @@ -314,35 +314,6 @@ void InstallationValidator::ValidateQueryEULAAcceptanceCommand( ValidateAppCommandFlags(ctx, app_cmd, flags_exp, name, is_valid); } -// Validates the "quick-enable-cf" Google Update product command. -void InstallationValidator::ValidateQuickEnableCfCommand( - const ProductContext& ctx, - const AppCommand& app_cmd, - bool* is_valid) { - DCHECK(is_valid); - - CommandLine cmd_line(CommandLine::FromString(app_cmd.command_line())); - string16 name(kCmdQuickEnableCf); - - ValidateSetupPath(ctx, cmd_line.GetProgram(), name, is_valid); - - SwitchExpectations expected; - - expected.push_back( - std::make_pair(std::string(switches::kChromeFrameQuickEnable), true)); - expected.push_back(std::make_pair(std::string(switches::kSystemLevel), - ctx.system_install)); - expected.push_back(std::make_pair(std::string(switches::kMultiInstall), - ctx.state.is_multi_install())); - - ValidateCommandExpectations(ctx, cmd_line, expected, name, is_valid); - - std::set flags_exp; - flags_exp.insert(google_update::kRegSendsPingsField); - flags_exp.insert(google_update::kRegWebAccessibleField); - ValidateAppCommandFlags(ctx, app_cmd, flags_exp, name, is_valid); -} - // Validates the "quick-enable-application-host" Google Update product command. void InstallationValidator::ValidateQuickEnableApplicationHostCommand( const ProductContext& ctx, @@ -421,20 +392,12 @@ void InstallationValidator::ValidateBinariesCommands( bool* is_valid) { DCHECK(is_valid); - // The quick-enable-cf command must be present if Chrome Binaries are - // installed and Chrome Frame is not installed. - const ChannelInfo& channel = ctx.state.channel(); const ProductState* binaries_state = ctx.machine_state.GetProductState( ctx.system_install, BrowserDistribution::CHROME_BINARIES); - const ProductState* cf_state = ctx.machine_state.GetProductState( - ctx.system_install, BrowserDistribution::CHROME_FRAME); CommandExpectations expectations; if (binaries_state != NULL) { - if (cf_state == NULL) - expectations[kCmdQuickEnableCf] = &ValidateQuickEnableCfCommand; - expectations[kCmdQuickEnableApplicationHost] = &ValidateQuickEnableApplicationHostCommand; diff --git a/chrome/installer/util/installation_validator.h b/chrome/installer/util/installation_validator.h index 2ef5b381c288c8..6072bae871f646 100644 --- a/chrome/installer/util/installation_validator.h +++ b/chrome/installer/util/installation_validator.h @@ -210,9 +210,6 @@ class InstallationValidator { static void ValidateQueryEULAAcceptanceCommand(const ProductContext& ctx, const AppCommand& app_cmd, bool* is_valid); - static void ValidateQuickEnableCfCommand(const ProductContext& ctx, - const AppCommand& app_cmd, - bool* is_valid); static void ValidateQuickEnableApplicationHostCommand( const ProductContext& ctx, const AppCommand& app_cmd, diff --git a/chrome/installer/util/installation_validator_unittest.cc b/chrome/installer/util/installation_validator_unittest.cc index fffcf2bd8762e2..d5abb1392023f1 100644 --- a/chrome/installer/util/installation_validator_unittest.cc +++ b/chrome/installer/util/installation_validator_unittest.cc @@ -94,10 +94,6 @@ class FakeProductState : public ProductState { Level install_level, const char* version, int channel_modifiers); - void AddQuickEnableCfCommand(BrowserDistribution::Type dist_type, - Level install_level, - const char* version, - int channel_modifiers); void set_multi_install(bool is_multi_install) { multi_install_ = is_multi_install; } @@ -298,27 +294,6 @@ void FakeProductState::AddQuickEnableApplicationHostCommand( commands_.Set(installer::kCmdQuickEnableApplicationHost, app_cmd); } -// Adds the "quick-enable-cf" Google Update product command. -void FakeProductState::AddQuickEnableCfCommand( - BrowserDistribution::Type dist_type, - Level install_level, - const char* version, - int channel_modifiers) { - DCHECK_EQ(dist_type, BrowserDistribution::CHROME_BINARIES); - DCHECK_NE(channel_modifiers & CM_MULTI, 0); - - CommandLine cmd_line(GetSetupExePath(dist_type, install_level, version, - channel_modifiers)); - cmd_line.AppendSwitch(installer::switches::kMultiInstall); - if (install_level == SYSTEM_LEVEL) - cmd_line.AppendSwitch(installer::switches::kSystemLevel); - cmd_line.AppendSwitch(installer::switches::kChromeFrameQuickEnable); - AppCommand app_cmd(cmd_line.GetCommandLineString()); - app_cmd.set_sends_pings(true); - app_cmd.set_is_web_accessible(true); - commands_.Set(installer::kCmdQuickEnableCf, app_cmd); -} - } // namespace // Fixture for testing the InstallationValidator. Errors logged by the @@ -501,10 +476,6 @@ void InstallationValidatorTest::MakeProductState( channel_modifiers, vehicle); state->set_multi_install(is_multi_install); if (prod_type == BrowserDistribution::CHROME_BINARIES) { - if (inst_type == InstallationValidator::CHROME_MULTI) { - state->AddQuickEnableCfCommand(prod_type, install_level, - chrome::kChromeVersion, channel_modifiers); - } state->AddQueryEULAAcceptanceCommand(prod_type, install_level, chrome::kChromeVersion, diff --git a/chrome/installer/util/util_constants.cc b/chrome/installer/util/util_constants.cc index 860eb898fb0a46..9486643fdceff8 100644 --- a/chrome/installer/util/util_constants.cc +++ b/chrome/installer/util/util_constants.cc @@ -27,9 +27,6 @@ const char kChromeAppLauncher[] = "app-launcher"; // Install Chrome Frame. const char kChromeFrame[] = "chrome-frame"; -// Installs Chrome Frame from an already installed multi-install of Chrome. -const char kChromeFrameQuickEnable[] = "quick-enable-cf"; - // Run the installer for Chrome SxS. const char kChromeSxS[] = "chrome-sxs"; diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h index 3dd1123740fc30..2f61e62b0ec38b 100644 --- a/chrome/installer/util/util_constants.h +++ b/chrome/installer/util/util_constants.h @@ -144,7 +144,6 @@ extern const char kChrome[]; extern const char kChromeAppHostDeprecated[]; // TODO(huangs): Remove by M27. extern const char kChromeAppLauncher[]; extern const char kChromeFrame[]; -extern const char kChromeFrameQuickEnable[]; extern const char kChromeSxS[]; extern const char kConfigureUserSettings[]; extern const char kCriticalUpdateVersion[];