diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-19 23:05:25 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-19 23:05:25 +0000 |
commit | 8f794cb1c1a3a989cf1fb2e453a56afadfa8db4c (patch) | |
tree | 3c6caa4facc64ee5e257591b135554b26027a2ff /chrome/installer/util/shell_util.cc | |
parent | 721c3f17a7fb36edaa17f607a11db9c82ba720ca (diff) | |
download | chromium_src-8f794cb1c1a3a989cf1fb2e453a56afadfa8db4c.zip chromium_src-8f794cb1c1a3a989cf1fb2e453a56afadfa8db4c.tar.gz chromium_src-8f794cb1c1a3a989cf1fb2e453a56afadfa8db4c.tar.bz2 |
Move creation of 'open with' registry keys to installer. We should place nice and not create these keys on every Chrome start just in case user wants a customized open with list. So now we only create these keys at installation or when user choses to make Chrome default browser. Also we clean them up on uninstall.
BUG=1190855
Review URL: http://codereview.chromium.org/11491
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5726 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/shell_util.cc')
-rw-r--r-- | chrome/installer/util/shell_util.cc | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index 4f97cd6..ba8c0fe 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -11,7 +11,7 @@ #include <shellapi.h> #include <shlobj.h> -#include "shell_util.h" +#include "chrome/installer/util/shell_util.h" #include "base/file_util.h" #include "base/logging.h" @@ -57,6 +57,17 @@ class RegistryEntry { entries.push_front(new RegistryEntry( L"Software\\Classes\\ChromeHTML\\shell\\open\\command", open_cmd)); + std::wstring exe_name = file_util::GetFilenameFromPath(chrome_exe); + std::wstring app_key = L"Software\\Classes\\Applications\\" + exe_name + + L"\\shell\\open\\command"; + entries.push_front(new RegistryEntry(app_key, open_cmd)); + for (int i = 0; ShellUtil::kFileAssociations[i] != NULL; i++) { + std::wstring open_with_key(L"Software\\Classes\\"); + open_with_key.append(ShellUtil::kFileAssociations[i]); + open_with_key.append(L"\\OpenWithList\\" + exe_name); + entries.push_front(new RegistryEntry(open_with_key, std::wstring())); + } + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); entries.push_front(new RegistryEntry( L"Software\\Clients\\StartMenuInternet\\chrome.exe", @@ -333,6 +344,8 @@ const wchar_t* ShellUtil::kRegRegisteredApplications = const wchar_t* ShellUtil::kRegShellChromeHTML = L"\\shell\\ChromeHTML"; const wchar_t* ShellUtil::kRegShellChromeHTMLCommand = L"\\shell\\ChromeHTML\\command"; +const wchar_t* ShellUtil::kRegVistaUrlPrefs = + L"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice"; const wchar_t* ShellUtil::kChromeHTMLProgId = L"ChromeHTML"; const wchar_t* ShellUtil::kFileAssociations[] = {L".htm", L".html", L".shtml", |