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

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

Issue 11146003: Remove the run verb on Windows 8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: separate method Created 8 years, 2 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 | « no previous file | 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 5ababade20aec9b482ef9497fb9a5c179706bb92..498d027b2118349d0fbfab97c7baa408c982ced3 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -239,11 +239,10 @@ class RegistryEntry {
// <root hkey>\Software\Classes\<app_id>\.exe\shell @=open
entries->push_back(new RegistryEntry(model_id_shell,
- ShellUtil::kRegVerbOpen));
+ ShellUtil::kRegVerbOpen));
const wchar_t* const verbs[] = { ShellUtil::kRegVerbOpen,
- ShellUtil::kRegVerbOpenNewWindow,
- ShellUtil::kRegVerbRun };
+ ShellUtil::kRegVerbOpenNewWindow };
for (size_t i = 0; i < arraysize(verbs); ++i) {
string16 sub_path(model_id_shell);
sub_path.push_back(FilePath::kSeparators[0]);
@@ -1015,6 +1014,28 @@ base::win::ShortcutProperties GetShortcutPropertiesFromChromeShortcutProperties(
return shortcut_properties;
}
+// Cleans up an old verb (run) we used to register in
+// <root>\Software\Classes\Chrome<.suffix>\.exe\shell\run.
+// TODO (gab): This was fixed before the official release of Windows 8 and thus
grt (UTC plus 2) 2012/10/16 01:43:03 "official release" -> "general availability"
gab 2012/10/16 14:59:50 Done.
+// can safely be removed in February 2013.
+void RemoveRunVerbOnWindows8(
+ BrowserDistribution* dist,
+ const string16& chrome_exe) {
+ HKEY root_key = DetermineShellIntegrationRoot(
grt (UTC plus 2) 2012/10/16 01:43:03 wrap this function in: if (IsChromeMetroSupported(
grt (UTC plus 2) 2012/10/16 01:43:03 is root_key always HKCU?
gab 2012/10/16 14:59:50 Done.
gab 2012/10/16 14:59:50 HKCU on user-level installs, HKLM on system-level
grt (UTC plus 2) 2012/10/16 15:31:13 Oh yeah. Good call.
+ InstallUtil::IsPerUserInstall(chrome_exe.c_str()));
grt (UTC plus 2) 2012/10/16 01:43:03 store the value of IsPerUserInstall() and re-use o
gab 2012/10/16 14:59:50 Indeed! Done.
+ // There's no need to rollback, so forgo the usual work item lists and just
+ // remove the key from the registry.
+ string16 run_verb_key(ShellUtil::kRegClasses);
+ run_verb_key.push_back(FilePath::kSeparators[0]);
+ run_verb_key.append(ShellUtil::GetBrowserModelId(
+ dist, InstallUtil::IsPerUserInstall(chrome_exe.c_str())));
+ run_verb_key.append(ShellUtil::kRegExePath);
+ run_verb_key.append(ShellUtil::kRegShellPath);
+ run_verb_key.push_back(FilePath::kSeparators[0]);
+ run_verb_key.append(ShellUtil::kRegVerbRun);
+ InstallUtil::DeleteRegistryKey(root_key, run_verb_key);
+}
+
} // namespace
const wchar_t* ShellUtil::kRegDefaultIcon = L"\\DefaultIcon";
@@ -1519,6 +1540,9 @@ bool ShellUtil::RegisterChromeBrowser(BrowserDistribution* dist,
// TODO(grt): remove this on or after 2012-08-01; see impl for details.
RemoveBadWindows8RegistrationIfNeeded(dist, chrome_exe);
+ // TODO(gab): remove this on or after 2013-02-01; see impl for details.
+ RemoveRunVerbOnWindows8(dist, chrome_exe);
+
// Check if Chromium is already registered with this suffix.
if (IsChromeRegistered(dist, chrome_exe, suffix))
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698