Index: chrome/browser/shell_integration.cc |
diff --git a/chrome/browser/shell_integration.cc b/chrome/browser/shell_integration.cc |
index ebcadbd1c45853cc25c1c4361ca6c8bb85c8be8d..6f1957a74f78536cee3f142d7f167773b7f65c64 100644 |
--- a/chrome/browser/shell_integration.cc |
+++ b/chrome/browser/shell_integration.cc |
@@ -1,4 +1,4 @@ |
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
+// Copyright (c) 2009 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
@@ -33,15 +33,9 @@ bool ShellIntegration::SetAsDefaultBrowser() { |
return false; |
} |
- ShellUtil::RegisterStatus register_status = |
- ShellUtil::AddChromeToSetAccessDefaults(chrome_exe, false); |
- if (register_status == ShellUtil::FAILURE) { |
- LOG(ERROR) << "Chrome could not be registered on the machine."; |
- return false; |
- } |
- |
// From UI currently we only allow setting default browser for current user. |
- if (!ShellUtil::MakeChromeDefault(ShellUtil::CURRENT_USER, chrome_exe)) { |
+ if (!ShellUtil::MakeChromeDefault(ShellUtil::CURRENT_USER, |
+ chrome_exe, true)) { |
LOG(ERROR) << "Chrome could not be set as default browser."; |
return false; |
} |
@@ -77,14 +71,22 @@ bool ShellIntegration::IsDefaultBrowser() { |
if (!SUCCEEDED(hr)) |
return false; |
+ BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
+ std::wstring app_name = dist->GetApplicationName(); |
+ std::wstring app_name_with_suffix; |
+ ShellUtil::GetUserSpecificDefaultBrowserSuffix(&app_name_with_suffix); |
+ app_name_with_suffix = app_name + app_name_with_suffix; |
for (int i = 0; i < _countof(kChromeProtocols); i++) { |
BOOL result = TRUE; |
- BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
hr = pAAR->QueryAppIsDefault(kChromeProtocols[i].c_str(), AT_URLPROTOCOL, |
- AL_EFFECTIVE, dist->GetApplicationName().c_str(), &result); |
+ AL_EFFECTIVE, app_name_with_suffix.c_str(), &result); |
if (!SUCCEEDED(hr) || (result == FALSE)) { |
- pAAR->Release(); |
- return false; |
+ hr = pAAR->QueryAppIsDefault(kChromeProtocols[i].c_str(), |
+ AT_URLPROTOCOL, AL_EFFECTIVE, app_name.c_str(), &result); |
+ if (!SUCCEEDED(hr) || (result == FALSE)) { |
+ pAAR->Release(); |
+ return false; |
+ } |
} |
} |
pAAR->Release(); |