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

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

Issue 15255004: Refactor of BrowserDistribution. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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
Index: chrome/installer/setup/install_worker.cc
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc
index c92219032b35bd77ca230dade2043cdb6d4d4476..e49ab4fe45b1e80dd4e80dc72e69bf2f9a850389 100644
--- a/chrome/installer/setup/install_worker.cc
+++ b/chrome/installer/setup/install_worker.cc
@@ -438,7 +438,8 @@ void AddDeleteUninstallShortcutsForMSIWorkItems(
LOG(ERROR) << "Failed to get location for shortcut.";
} else {
uninstall_link = uninstall_link.Append(
- product.distribution()->GetAppShortCutName());
+ product.distribution()->
+ GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME).name);
gab 2013/05/18 23:57:22 This is a case where GetAppShortCutName() was used
calamity 2013/05/24 02:03:11 Done.
uninstall_link = uninstall_link.Append(
product.distribution()->GetUninstallLinkName() + installer::kLnkExt);
VLOG(1) << "Deleting old uninstall shortcut (if present): "
@@ -723,7 +724,9 @@ void AddUninstallShortcutWorkItems(const InstallerState& installer_state,
install_list->AddCreateRegKeyWorkItem(reg_root, uninstall_reg);
install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg,
installer::kUninstallDisplayNameField,
- browser_dist->GetAppShortCutName(), true);
+ browser_dist->
+ GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME).name,
+ true);
install_list->AddSetRegValueWorkItem(reg_root,
uninstall_reg, installer::kUninstallStringField,
quoted_uninstall_cmd.GetCommandLineString(), true);
@@ -734,9 +737,11 @@ void AddUninstallShortcutWorkItems(const InstallerState& installer_state,
true);
BrowserDistribution* dist = product.distribution();
+ BrowserDistribution::ShortcutInfo shortcut_info =
+ dist->GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME);
string16 chrome_icon = ShellUtil::FormatIconLocation(
- install_path.Append(dist->GetIconFilename()).value(),
- dist->GetIconIndex());
+ install_path.Append(shortcut_info.icon_file).value(),
+ shortcut_info.icon_index);
install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg,
L"DisplayIcon", chrome_icon, true);
install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg,
@@ -786,7 +791,8 @@ void AddVersionKeyWorkItems(HKEY root,
string16 version_key(dist->GetVersionKey());
list->AddCreateRegKeyWorkItem(root, version_key);
- string16 product_name(dist->GetAppShortCutName());
+ string16 product_name(
+ dist->GetShortcutInfo(BrowserDistribution::SHORTCUT_CHROME).name);
list->AddSetRegValueWorkItem(root, version_key, google_update::kRegNameField,
product_name, true); // overwrite name also
list->AddSetRegValueWorkItem(root, version_key,
@@ -845,7 +851,7 @@ void AddOemInstallWorkItems(const InstallationState& original_state,
if (source_product->GetOemInstall(&oem_install)) {
VLOG(1) << "Mirroring oeminstall=\"" << oem_install << "\" from "
<< BrowserDistribution::GetSpecificDistribution(source_type)->
- GetAppShortCutName();
+ GetDisplayName();
install_list->AddCreateRegKeyWorkItem(root_key, multi_key);
// Always overwrite an old value.
install_list->AddSetRegValueWorkItem(root_key, multi_key,
@@ -900,7 +906,7 @@ void AddEulaAcceptedWorkItems(const InstallationState& original_state,
if (have_eula_accepted) {
VLOG(1) << "Mirroring eulaaccepted=" << eula_accepted << " from "
<< BrowserDistribution::GetSpecificDistribution(product_type)->
- GetAppShortCutName();
+ GetDisplayName();
install_list->AddCreateRegKeyWorkItem(root_key, multi_key);
install_list->AddSetRegValueWorkItem(
root_key, multi_key, google_update::kRegEULAAceptedField,
@@ -1439,7 +1445,7 @@ void AddDelegateExecuteWorkItems(const InstallerState& installer_state,
CleanupBadCanaryDelegateExecuteRegistration(target_path, list);
} else {
VLOG(1) << "No DelegateExecute verb handler processing to do for "
- << distribution->GetAppShortCutName();
+ << distribution->GetDisplayName();
}
return;
}
@@ -1501,7 +1507,7 @@ void AddActiveSetupWorkItems(const InstallerState& installer_state,
const char* install_level =
installer_state.system_install() ? "system" : "user";
VLOG(1) << "No Active Setup processing to do for " << install_level
- << "-level " << distribution->GetAppShortCutName();
+ << "-level " << distribution->GetDisplayName();
return;
}
DCHECK(installer_state.RequiresActiveSetup());
@@ -1513,7 +1519,7 @@ void AddActiveSetupWorkItems(const InstallerState& installer_state,
VLOG(1) << "Adding registration items for Active Setup.";
list->AddCreateRegKeyWorkItem(root, active_setup_path);
list->AddSetRegValueWorkItem(root, active_setup_path, L"",
- distribution->GetAppShortCutName(), true);
+ distribution->GetDisplayName(), true);
base::FilePath active_setup_exe(installer_state.GetInstallerDirectory(
new_version).Append(kActiveSetupExe));
@@ -1528,7 +1534,7 @@ void AddActiveSetupWorkItems(const InstallerState& installer_state,
// TODO(grt): http://crbug.com/75152 Write a reference to a localized
// resource.
list->AddSetRegValueWorkItem(root, active_setup_path, L"Localized Name",
- distribution->GetAppShortCutName(), true);
+ distribution->GetDisplayName(), true);
list->AddSetRegValueWorkItem(root, active_setup_path, L"IsInstalled",
static_cast<DWORD>(1U), true);

Powered by Google App Engine
This is Rietveld 408576698