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

Unified Diff: chrome/installer/util/shell_util.cc

Issue 10446111: Abstract suffixing logic away from GetApplicationName (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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/util/shell_util.cc
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 93e946d4ea63c3e91bf15bf7aaceb96b31bb4108..392291c1c4bf65601a1349594beb8b4564598721 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -92,7 +92,7 @@ class RegistryEntry {
DCHECK(suffix.empty() || suffix[0] == L'.');
return string16(ShellUtil::kRegStartMenuInternet)
.append(1, L'\\')
- .append(dist->GetApplicationName())
+ .append(dist->GetUnsuffixedAppName())
.append(suffix);
}
@@ -212,7 +212,7 @@ class RegistryEntry {
// resource for name, description, and company.
entries->push_front(new RegistryEntry(
chrome_application, ShellUtil::kRegApplicationName,
- dist->GetApplicationName().append(suffix)));
+ dist->GetAppShortCutName().append(suffix)));
entries->push_front(new RegistryEntry(
chrome_application, ShellUtil::kRegApplicationDescription,
dist->GetAppDescription()));
@@ -251,7 +251,7 @@ class RegistryEntry {
// TODO(grt): http://crbug.com/75152 Also set LocalizedString; see
// http://msdn.microsoft.com/en-us/library/windows/desktop/cc144109(v=VS.85).aspx#registering_the_display_name
entries->push_front(new RegistryEntry(
- start_menu_entry, dist->GetApplicationName()));
+ start_menu_entry, dist->GetAppShortCutName()));
// Register the "open" verb for launching Chrome via the "Internet" link.
entries->push_front(new RegistryEntry(
start_menu_entry + ShellUtil::kRegShellOpen, quoted_exe_path));
@@ -272,7 +272,7 @@ class RegistryEntry {
entries->push_front(new RegistryEntry(install_info, L"IconsVisible", 1));
// Register with Default Programs.
- string16 reg_app_name(dist->GetApplicationName().append(suffix));
+ string16 reg_app_name(dist->GetUnsuffixedAppName().append(suffix));
// Tell Windows where to find Chrome's Default Programs info.
string16 capabilities(GetCapabilitiesKey(dist, suffix));
entries->push_front(new RegistryEntry(ShellUtil::kRegRegisteredApplications,
@@ -287,7 +287,7 @@ class RegistryEntry {
capabilities, ShellUtil::kRegApplicationIcon, icon_path));
entries->push_front(new RegistryEntry(
capabilities, ShellUtil::kRegApplicationName,
- dist->GetApplicationName()));
+ dist->GetAppShortCutName()));
entries->push_front(new RegistryEntry(capabilities + L"\\Startmenu",
L"StartMenuInternet", reg_app_name));
@@ -381,7 +381,7 @@ class RegistryEntry {
// start->Internet shortcut.
string16 start_menu(ShellUtil::kRegStartMenuInternet);
- string16 app_name = dist->GetApplicationName() + suffix;
+ string16 app_name = dist->GetUnsuffixedAppName() + suffix;
entries->push_front(new RegistryEntry(start_menu, app_name));
return true;
}
@@ -958,7 +958,7 @@ void ShellUtil::GetRegisteredBrowsers(
continue;
}
if (!name.empty() && !command.empty() &&
- name.find(dist->GetApplicationName()) == string16::npos)
+ name.find(dist->GetUnsuffixedAppName()) == string16::npos)
(*browsers)[name] = command;
}
}
@@ -1033,9 +1033,7 @@ bool ShellUtil::MakeChromeDefault(BrowserDistribution* dist,
bool ret = true;
// First use the new "recommended" way on Vista to make Chrome default
// browser.
- string16 app_name = dist->GetApplicationName();
- const string16 app_suffix(ShellUtil::GetCurrentInstallationSuffix());
- app_name += app_suffix;
+ string16 app_name = dist->GetAppName();
if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
// On Windows 8, you can't set yourself as the default handler
@@ -1085,7 +1083,8 @@ bool ShellUtil::MakeChromeDefault(BrowserDistribution* dist,
std::list<RegistryEntry*> entries;
STLElementDeleter<std::list<RegistryEntry*> > entries_deleter(&entries);
- RegistryEntry::GetUserEntries(dist, chrome_exe, app_suffix, &entries);
+ RegistryEntry::GetUserEntries(
+ dist, chrome_exe, ShellUtil::GetCurrentInstallationSuffix(), &entries);
// Change the default browser for current user.
if ((shell_change & ShellUtil::CURRENT_USER) &&
!AddRegistryEntries(HKEY_CURRENT_USER, entries)) {
@@ -1124,9 +1123,7 @@ bool ShellUtil::MakeChromeDefaultProtocolClient(BrowserDistribution* dist,
HRESULT hr = pAAR.CreateInstance(CLSID_ApplicationAssociationRegistration,
NULL, CLSCTX_INPROC);
if (SUCCEEDED(hr)) {
- string16 app_name = dist->GetApplicationName();
- app_name += ShellUtil::GetCurrentInstallationSuffix();
-
+ string16 app_name = dist->GetAppName();
hr = pAAR->SetAppAsDefault(app_name.c_str(), protocol.c_str(),
AT_URLPROTOCOL);
}
« chrome/installer/util/browser_distribution.cc ('K') | « chrome/installer/util/installer_state.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698