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

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

Issue 10542031: Suffix Chrome's appid on user-level installs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove install logic order changes and modify naming/comments 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
Index: chrome/installer/util/shell_util.cc
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 432806542c210d2d4a5a1234a2011ac898a579de..08df64ea991ebcc96fc142363382dedac0071870 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -135,7 +135,7 @@ class RegistryEntry {
string16 delegate_command(ShellUtil::GetChromeDelegateCommand(chrome_exe));
// For user-level installs: entries for the app id and DelegateExecute verb
// handler will be in HKCU; thus we do not need a suffix on those entries.
- string16 app_id(dist->GetBrowserAppId());
+ string16 app_id(ShellUtil::GetAppId(dist, chrome_exe));
string16 delegate_guid;
// TODO(grt): remove HasDelegateExecuteHandler when the exe is ever-present;
// see also install_worker.cc's AddDelegateExecuteWorkItems.
@@ -662,7 +662,7 @@ void RemoveBadWindows8RegistrationIfNeeded(
// suffix.
const string16 installation_suffix(
ShellUtil::GetCurrentInstallationSuffix(dist, chrome_exe));
- const string16 app_id(dist->GetBrowserAppId());
+ const string16 app_id(ShellUtil::GetAppId(dist, chrome_exe));
// <root hkey>\Software\Classes\<app_id>
string16 key(ShellUtil::kRegClasses);
@@ -1073,6 +1073,17 @@ string16 ShellUtil::GetApplicationName(BrowserDistribution* dist,
return app_name;
}
+string16 ShellUtil::GetAppId(BrowserDistribution* dist,
+ const string16& chrome_exe) {
+ string16 app_id(dist->GetBaseAppId());
+ string16 suffix;
+ if (InstallUtil::IsPerUserInstall(chrome_exe.c_str()) &&
+ !GetUserSpecificRegistrySuffix(&suffix)) {
+ NOTREACHED();
+ }
+ return app_id.append(suffix);
+}
+
bool ShellUtil::MakeChromeDefault(BrowserDistribution* dist,
int shell_change,
const string16& chrome_exe,
@@ -1432,24 +1443,25 @@ bool ShellUtil::UpdateChromeShortcut(BrowserDistribution* dist,
const string16& icon_path,
int icon_index,
uint32 options) {
- string16 chrome_path = FilePath(chrome_exe).DirName().value();
+ const FilePath chrome_path(FilePath(chrome_exe).DirName());
- FilePath prefs_path(chrome_path);
- prefs_path = prefs_path.AppendASCII(installer::kDefaultMasterPrefs);
- installer::MasterPreferences prefs(prefs_path);
+ installer::MasterPreferences prefs(
+ chrome_path.AppendASCII(installer::kDefaultMasterPrefs));
if (FilePath::CompareEqualIgnoreCase(icon_path, chrome_exe)) {
prefs.GetInt(installer::master_preferences::kChromeShortcutIconIndex,
&icon_index);
}
+ const string16 app_id(GetAppId(dist, chrome_exe));
+
return file_util::CreateOrUpdateShortcutLink(
chrome_exe.c_str(),
shortcut.c_str(),
- chrome_path.c_str(),
+ chrome_path.value().c_str(),
arguments.c_str(),
description.c_str(),
icon_path.c_str(),
icon_index,
- dist->GetBrowserAppId().c_str(),
+ app_id.c_str(),
ConvertShellUtilShortcutOptionsToFileUtil(options));
}

Powered by Google App Engine
This is Rietveld 408576698