diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-20 23:26:37 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-20 23:26:37 +0000 |
commit | a173cc9be851b100258d23771ecbee00cc9f44e1 (patch) | |
tree | d7307abe4d76d02f764264c7bf30c60ccd647801 /chrome/installer/util/shell_util.cc | |
parent | 26d008948bbddd48e5fa8c9de9c6586123055d0c (diff) | |
download | chromium_src-a173cc9be851b100258d23771ecbee00cc9f44e1.zip chromium_src-a173cc9be851b100258d23771ecbee00cc9f44e1.tar.gz chromium_src-a173cc9be851b100258d23771ecbee00cc9f44e1.tar.bz2 |
Re-apply r23841 "During uninstall if Chrome is set as default"
BUG=14023
TEST=Make sure the option of choosing a different browser shows up during un
Review URL: http://codereview.chromium.org/174194
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23915 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/shell_util.cc')
-rw-r--r-- | chrome/installer/util/shell_util.cc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index 88674dc..f21aeab 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -583,6 +583,32 @@ bool ShellUtil::GetQuickLaunchPath(bool system_level, std::wstring* path) { return true; } +void ShellUtil::GetRegisteredBrowsers(std::map<std::wstring, + std::wstring>* browsers) { + std::wstring base_key(ShellUtil::kRegStartMenuInternet); + HKEY root = HKEY_LOCAL_MACHINE; + for (RegistryKeyIterator iter(root, base_key.c_str()); iter.Valid(); ++iter) { + std::wstring key = base_key + L"\\" + iter.Name(); + RegKey capabilities(root, (key + L"\\Capabilities").c_str()); + std::wstring name; + if (!capabilities.Valid() || + !capabilities.ReadValue(L"ApplicationName", &name)) { + RegKey base_key(root, key.c_str()); + if (!base_key.ReadValue(L"", &name)) + continue; + } + RegKey install_info(root, (key + L"\\InstallInfo").c_str()); + std::wstring command; + if (!install_info.Valid() || + !install_info.ReadValue(L"ReinstallCommand", &command)) + continue; + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); + if (!name.empty() && !command.empty() && + name.find(dist->GetApplicationName()) == std::wstring::npos) + (*browsers)[name] = command; + } +} + bool ShellUtil::GetUserSpecificDefaultBrowserSuffix(std::wstring* entry) { wchar_t user_name[256]; DWORD size = _countof(user_name); |