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

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: merge up to 162133 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 fd1c0d8e61dfeb468135a7947715fc7d5d24ed70..ba9febf39cf50ba1b85b5e87fb840cf3e0d6b699 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -240,11 +240,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]);
@@ -1016,6 +1015,30 @@ 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 on Windows 8.
+// TODO (gab): This was fixed before the general availability of Windows 8 and
+// thus can safely be removed in February 2013.
+void RemoveRunVerbOnWindows8(
+ BrowserDistribution* dist,
+ const string16& chrome_exe) {
+ if (IsChromeMetroSupported()) {
+ bool is_per_user_install =InstallUtil::IsPerUserInstall(chrome_exe.c_str());
+ HKEY root_key = DetermineShellIntegrationRoot(is_per_user_install);
+ // 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, is_per_user_install));
+ 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);
+ }
+}
+
// Gets the short (8.3) form of |path|, putting the result in |short_path| and
// returning true on success. |short_path| is not modified on failure.
bool ShortNameFromPath(const FilePath& path, string16* short_path) {
@@ -1694,6 +1717,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