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

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: use GetAppShortCutName() in logs Created 8 years, 6 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 | « chrome/installer/util/shell_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/shell_util.cc
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 8700a7739f1c7e5f3463716ce8da46429c14394c..bbee4f78d6145df929f548dc94794baf5aa7af08 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -109,7 +109,7 @@ class RegistryEntry {
DCHECK(suffix.empty() || suffix[0] == L'.');
return string16(ShellUtil::kRegStartMenuInternet)
.append(1, L'\\')
- .append(dist->GetApplicationName())
+ .append(dist->GetBaseAppName())
.append(suffix);
}
@@ -213,7 +213,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()));
@@ -252,7 +252,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));
@@ -273,7 +273,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->GetBaseAppName().append(suffix));
// Tell Windows where to find Chrome's Default Programs info.
string16 capabilities(GetCapabilitiesKey(dist, suffix));
entries->push_front(new RegistryEntry(ShellUtil::kRegRegisteredApplications,
@@ -382,7 +382,7 @@ class RegistryEntry {
// start->Internet shortcut.
string16 start_menu(ShellUtil::kRegStartMenuInternet);
- string16 app_name = dist->GetApplicationName() + suffix;
+ string16 app_name = dist->GetBaseAppName() + suffix;
entries->push_front(new RegistryEntry(start_menu, app_name));
return true;
}
@@ -1025,7 +1025,7 @@ void ShellUtil::GetRegisteredBrowsers(
continue;
}
if (!name.empty() && !command.empty() &&
- name.find(dist->GetApplicationName()) == string16::npos)
+ name.find(dist->GetBaseAppName()) == string16::npos)
(*browsers)[name] = command;
}
}
@@ -1042,6 +1042,13 @@ string16 ShellUtil::GetCurrentInstallationSuffix(BrowserDistribution* dist,
return tested_suffix;
}
+string16 ShellUtil::GetApplicationName(BrowserDistribution* dist,
+ const string16& chrome_exe) {
+ string16 app_name = dist->GetBaseAppName();
+ app_name += GetCurrentInstallationSuffix(dist, chrome_exe);
+ return app_name;
+}
+
bool ShellUtil::MakeChromeDefault(BrowserDistribution* dist,
int shell_change,
const string16& chrome_exe,
@@ -1065,10 +1072,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(dist, chrome_exe));
- app_name += app_suffix;
+ string16 app_name = GetApplicationName(dist, chrome_exe);
if (base::win::GetVersion() >= base::win::VERSION_VISTA) {
// On Windows Vista and Win7 we still can set ourselves via the
@@ -1108,7 +1112,10 @@ 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,
grt (UTC plus 2) 2012/06/11 17:51:50 nit: compress args for less vertical space.
gab 2012/06/11 19:33:27 Done.
+ chrome_exe,
+ GetCurrentInstallationSuffix(dist, chrome_exe),
+ &entries);
// Change the default browser for current user.
if ((shell_change & ShellUtil::CURRENT_USER) &&
!AddRegistryEntries(HKEY_CURRENT_USER, entries)) {
@@ -1165,9 +1172,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(dist, chrome_exe);
-
+ string16 app_name = GetApplicationName(dist, chrome_exe);
hr = pAAR->SetAppAsDefault(app_name.c_str(), protocol.c_str(),
AT_URLPROTOCOL);
}
« no previous file with comments | « chrome/installer/util/shell_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698