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

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

Issue 10837222: Enable EULA dialog to be shown from metro Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Dear Greg, the third. Created 8 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 | « chrome/installer/util/shell_util.h ('k') | chrome/installer/util/util_constants.h » ('j') | 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 f6e696c1f885aaaf39f0f2236de47cb32ebbbaff..43e1fd95d6d9f84a2a10dd5c669e93778f3e2399 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -216,7 +216,9 @@ 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(ShellUtil::GetBrowserModelId(dist, chrome_exe));
+ string16 app_id(
+ ShellUtil::GetBrowserModelId(
+ dist, InstallUtil::IsPerUserInstall(chrome_exe.c_str())));
string16 delegate_guid;
// TODO(grt): remove HasDelegateExecuteHandler when the exe is ever-present;
// see also install_worker.cc's AddDelegateExecuteWorkItems.
@@ -752,13 +754,16 @@ void RemoveBadWindows8RegistrationIfNeeded(
!IsChromeMetroSupported())) {
// There's no need to rollback, so forgo the usual work item lists and just
// remove the values from the registry.
- const HKEY root_key = InstallUtil::IsPerUserInstall(chrome_exe.c_str()) ?
- HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE;
+ bool is_per_user_install =
+ InstallUtil::IsPerUserInstall(chrome_exe.c_str());
+ const HKEY root_key = is_per_user_install ? HKEY_CURRENT_USER :
+ HKEY_LOCAL_MACHINE;
// Use the current installation's suffix, not the about-to-be-installed
// suffix.
const string16 installation_suffix(
ShellUtil::GetCurrentInstallationSuffix(dist, chrome_exe));
- const string16 app_id(ShellUtil::GetBrowserModelId(dist, chrome_exe));
+ const string16 app_id(ShellUtil::GetBrowserModelId(dist,
+ is_per_user_install));
// <root hkey>\Software\Classes\<app_id>
string16 key(ShellUtil::kRegClasses);
@@ -1213,11 +1218,10 @@ string16 ShellUtil::GetApplicationName(BrowserDistribution* dist,
}
string16 ShellUtil::GetBrowserModelId(BrowserDistribution* dist,
- const string16& chrome_exe) {
+ bool is_per_user_install) {
string16 app_id(dist->GetBaseAppId());
string16 suffix;
- if (InstallUtil::IsPerUserInstall(chrome_exe.c_str()) &&
- !GetUserSpecificRegistrySuffix(&suffix)) {
+ if (is_per_user_install && !GetUserSpecificRegistrySuffix(&suffix)) {
NOTREACHED();
}
// There is only one component (i.e. the suffixed appid) in this case, but it
@@ -1632,7 +1636,8 @@ void ShellUtil::RemoveChromeStartScreenShortcuts(BrowserDistribution* dist,
}
app_shortcuts_path = app_shortcuts_path.Append(
- GetBrowserModelId(dist, chrome_exe));
+ GetBrowserModelId(dist,
+ InstallUtil::IsPerUserInstall(chrome_exe.c_str())));
if (!file_util::DirectoryExists(app_shortcuts_path)) {
VLOG(1) << "No start screen shortcuts to delete.";
return;
@@ -1663,7 +1668,9 @@ bool ShellUtil::UpdateChromeShortcut(BrowserDistribution* dist,
&icon_index);
}
- const string16 app_id(GetBrowserModelId(dist, chrome_exe));
+ const string16 app_id(
+ GetBrowserModelId(dist,
+ InstallUtil::IsPerUserInstall(chrome_exe.c_str())));
const bool is_dual_mode = ((options & ShellUtil::SHORTCUT_DUAL_MODE) != 0);
const base::win::ShortcutOperation operation =
(options & ShellUtil::SHORTCUT_CREATE_ALWAYS) != 0 ?
« no previous file with comments | « chrome/installer/util/shell_util.h ('k') | chrome/installer/util/util_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698