summaryrefslogtreecommitdiffstats
path: root/chrome/browser/shell_integration_win.cc
diff options
context:
space:
mode:
authormdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-25 22:54:00 +0000
committermdm@chromium.org <mdm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-25 22:54:00 +0000
commitfe989f1881aad3beb18ed86b18f8cb19a11910ea (patch)
treed05decd90135a3a7c2f257ef5c9dfb3ff7306738 /chrome/browser/shell_integration_win.cc
parentcfe8a11e7670c898b60961bd6f8740be3e0d0244 (diff)
downloadchromium_src-fe989f1881aad3beb18ed86b18f8cb19a11910ea.zip
chromium_src-fe989f1881aad3beb18ed86b18f8cb19a11910ea.tar.gz
chromium_src-fe989f1881aad3beb18ed86b18f8cb19a11910ea.tar.bz2
Be more paranoid when checking the default browser in Windows and return "not default" rather than "can't tell" in most cases.
Also undo previous fixes that worked around an incorrect return value; one of them (the infobar change) regresses the Linux version to display the infobar in cases where we would not be able to set ourselves as the default anyway (which was the original reason for the change that broke things on Windows). BUG=28429, 27403 TEST=(windows) install chrome but don't set it as the default during install, then restart it and verify that the infobar shows and chrome can still be set as the default TEST=(linux) run chrome in an unsupported desktop environment and verify that it neither displays the infobar asking to be made the default browser nor claims that it is the default browser in options Review URL: http://codereview.chromium.org/434022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33147 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/shell_integration_win.cc')
-rw-r--r--chrome/browser/shell_integration_win.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc
index b340c95..1042cd4 100644
--- a/chrome/browser/shell_integration_win.cc
+++ b/chrome/browser/shell_integration_win.cc
@@ -69,7 +69,7 @@ ShellIntegration::DefaultBrowserState ShellIntegration::IsDefaultBrowser() {
NULL, CLSCTX_INPROC, __uuidof(IApplicationAssociationRegistration),
(void**)&pAAR);
if (!SUCCEEDED(hr))
- return UNKNOWN_DEFAULT_BROWSER;
+ return NOT_DEFAULT_BROWSER;
BrowserDistribution* dist = BrowserDistribution::GetDistribution();
std::wstring app_name = dist->GetApplicationName();
@@ -84,11 +84,7 @@ ShellIntegration::DefaultBrowserState ShellIntegration::IsDefaultBrowser() {
BOOL result = TRUE;
hr = pAAR->QueryAppIsDefault(kChromeProtocols[i].c_str(), AT_URLPROTOCOL,
AL_EFFECTIVE, app_name.c_str(), &result);
- if (!SUCCEEDED(hr)) {
- pAAR->Release();
- return UNKNOWN_DEFAULT_BROWSER;
- }
- if (result == FALSE) {
+ if (!SUCCEEDED(hr) || result == FALSE) {
pAAR->Release();
return NOT_DEFAULT_BROWSER;
}
@@ -109,7 +105,7 @@ ShellIntegration::DefaultBrowserState ShellIntegration::IsDefaultBrowser() {
RegKey key(root_key, key_path.c_str(), KEY_READ);
std::wstring value;
if (!key.Valid() || !key.ReadValue(L"", &value))
- return UNKNOWN_DEFAULT_BROWSER;
+ return NOT_DEFAULT_BROWSER;
// Need to normalize path in case it's been munged.
CommandLine command_line = CommandLine::FromString(value);
std::wstring short_path;