Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5144)

Unified Diff: chrome/installer/setup/install_worker.cc

Issue 619203002: [Installer] Make recent install_worker.cc changes use AppRegistrationData (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/install_worker.cc
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc
index ec65627a793ce63b2d11acbd526dd16d92d99815..bbc3f62ce37c14d76ec8a3070f566d9db2284aa7 100644
--- a/chrome/installer/setup/install_worker.cc
+++ b/chrome/installer/setup/install_worker.cc
@@ -31,6 +31,7 @@
#include "chrome/installer/setup/install.h"
#include "chrome/installer/setup/setup_constants.h"
#include "chrome/installer/setup/setup_util.h"
+#include "chrome/installer/util/app_registration_data.h"
#include "chrome/installer/util/browser_distribution.h"
#include "chrome/installer/util/callback_work_item.h"
#include "chrome/installer/util/conditional_work_item_list.h"
@@ -45,6 +46,7 @@
#include "chrome/installer/util/product.h"
#include "chrome/installer/util/set_reg_value_work_item.h"
#include "chrome/installer/util/shell_util.h"
+#include "chrome/installer/util/updating_app_registration_data.h"
#include "chrome/installer/util/util_constants.h"
#include "chrome/installer/util/work_item_list.h"
@@ -185,9 +187,9 @@ void AddInstallerCopyTasks(const InstallerState& installer_state,
}
}
-base::string16 GetRegCommandKey(BrowserDistribution* dist,
+base::string16 GetRegCommandKey(const AppRegistrationData& reg_data,
grt (UTC plus 2) 2014/10/01 20:14:26 this makes all callers' lives a bit more difficult
huangs 2014/10/01 22:39:20 Done.
const wchar_t* name) {
- base::string16 cmd_key(dist->GetVersionKey());
+ base::string16 cmd_key(reg_data.GetVersionKey());
cmd_key.append(1, base::FilePath::kSeparators[0])
.append(google_update::kRegCommandsKey)
.append(1, base::FilePath::kSeparators[0])
@@ -215,7 +217,8 @@ void AddCommandWithParameterWorkItems(const InstallerState& installer_state,
DCHECK(work_item_list);
base::string16 full_cmd_key(
- GetRegCommandKey(product.distribution(), command_key));
+ GetRegCommandKey(product.distribution()->GetAppRegistrationData(),
+ command_key));
if (installer_state.operation() == InstallerState::UNINSTALL) {
work_item_list->AddDeleteRegKeyWorkItem(installer_state.root_key(),
@@ -236,14 +239,14 @@ void AddCommandWithParameterWorkItems(const InstallerState& installer_state,
}
void AddLegacyAppCommandRemovalItem(const InstallerState& installer_state,
- BrowserDistribution* distribution,
+ const AppRegistrationData& reg_data,
const wchar_t* name,
WorkItemList* work_item_list) {
// These failures are ignored because this is a clean-up operation that
// shouldn't block an install or update on failing.
work_item_list->AddDeleteRegKeyWorkItem(
installer_state.root_key(),
- GetRegCommandKey(distribution, name),
+ GetRegCommandKey(reg_data, name),
KEY_WOW64_32KEY)->set_ignore_failure(true);
}
@@ -362,9 +365,11 @@ void AddQuickEnableApplicationLauncherWorkItems(
// always at user-level). So we do not try to remove the command, i.e., it
// will always be installed if the Chrome Binaries are installed.
if (will_have_chrome_binaries) {
+ BrowserDistribution* binaries_dist =
+ BrowserDistribution::GetSpecificDistribution(
+ BrowserDistribution::CHROME_BINARIES);
base::string16 cmd_key(
- GetRegCommandKey(BrowserDistribution::GetSpecificDistribution(
- BrowserDistribution::CHROME_BINARIES),
+ GetRegCommandKey(binaries_dist->GetAppRegistrationData(),
kCmdQuickEnableApplicationHost));
CommandLine cmd_line(GetGenericQuickEnableCommand(installer_state,
machine_state,
@@ -397,17 +402,18 @@ void AddProductSpecificWorkItems(const InstallationState& original_state,
AddFirewallRulesWorkItems(
installer_state, p.distribution(), is_new_install, list);
AddLegacyAppCommandRemovalItem(
- installer_state, p.distribution(), kLegacyCmdInstallExtension, list);
+ installer_state,
+ p.distribution()->GetAppRegistrationData(),
+ kLegacyCmdInstallExtension,
+ list);
if (p.distribution()->AppHostIsSupported()) {
// Unconditionally remove the "install-application" command from the app
// hosts's key.
- AddLegacyAppCommandRemovalItem(
- installer_state,
- BrowserDistribution::GetSpecificDistribution(
- BrowserDistribution::CHROME_APP_HOST),
- kLegacyCmdInstallApp,
- list);
+ UpdatingAppRegistrationData app_launcher_reg_data(
+ installer::kAppLauncherGuid);
+ AddLegacyAppCommandRemovalItem(installer_state, app_launcher_reg_data,
+ kLegacyCmdInstallApp, list);
}
}
if (p.is_chrome_binaries()) {
@@ -1590,7 +1596,8 @@ void AddOsUpgradeWorkItems(const InstallerState& installer_state,
WorkItemList* install_list) {
const HKEY root_key = installer_state.root_key();
base::string16 cmd_key(
- GetRegCommandKey(product.distribution(), kCmdOnOsUpgrade));
+ GetRegCommandKey(product.distribution()->GetAppRegistrationData(),
+ kCmdOnOsUpgrade));
if (installer_state.operation() == InstallerState::UNINSTALL) {
install_list->AddDeleteRegKeyWorkItem(root_key, cmd_key, KEY_WOW64_32KEY)
@@ -1623,7 +1630,8 @@ void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state,
WorkItemList* work_item_list) {
const HKEY root_key = installer_state.root_key();
base::string16 cmd_key(
- GetRegCommandKey(product.distribution(), kCmdQueryEULAAcceptance));
+ GetRegCommandKey(product.distribution()->GetAppRegistrationData(),
+ kCmdQueryEULAAcceptance));
if (installer_state.operation() == InstallerState::UNINSTALL) {
work_item_list->AddDeleteRegKeyWorkItem(root_key, cmd_key, KEY_WOW64_32KEY)
->set_log_message("Removing query EULA acceptance command");
@@ -1646,10 +1654,11 @@ void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state,
void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state,
WorkItemList* work_item_list) {
DCHECK(work_item_list);
-
+ BrowserDistribution* binaries_dist =
+ BrowserDistribution::GetSpecificDistribution(
+ BrowserDistribution::CHROME_BINARIES);
base::string16 cmd_key(
- GetRegCommandKey(BrowserDistribution::GetSpecificDistribution(
- BrowserDistribution::CHROME_BINARIES),
+ GetRegCommandKey(binaries_dist->GetAppRegistrationData(),
kCmdQuickEnableCf));
// Unconditionally remove the legacy Quick Enable command from the binaries.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698