Chromium Code Reviews| Index: chrome/browser/shell_integration_mac.mm |
| diff --git a/chrome/browser/shell_integration_mac.mm b/chrome/browser/shell_integration_mac.mm |
| index 8a52d7b86ca80b92daa4fea793e42f65620c5a73..b26cd330f6d67aab5973379a6c75f6796093f6fc 100644 |
| --- a/chrome/browser/shell_integration_mac.mm |
| +++ b/chrome/browser/shell_integration_mac.mm |
| @@ -10,16 +10,21 @@ |
| #include "chrome/common/chrome_version_info.h" |
| #import "third_party/mozilla/NSWorkspace+Utils.h" |
| -bool ShellIntegration::CanSetAsDefaultBrowser() { |
| - return chrome::VersionInfo::GetChannel() != |
| - chrome::VersionInfo::CHANNEL_CANARY; |
| +ShellIntegration::DefaultSettingsChangePermission |
| + ShellIntegration::CanSetAsDefaultBrowser() { |
| + if (chrome::VersionInfo::GetChannel() != |
| + chrome::VersionInfo::CHANNEL_CANARY) { |
| + return CHANGE_DEFAULT_UNATTENDED; |
| + } |
| + |
| + return CHANGE_DEFAULT_NOT_ALLOWED; |
| } |
| // Sets Chromium as default browser to be used by the operating system. This |
| // applies only for the current user. Returns false if this cannot be done, or |
| // if the operation fails. |
| bool ShellIntegration::SetAsDefaultBrowser() { |
| - if (!CanSetAsDefaultBrowser()) |
| + if (CanSetAsDefaultBrowser() != CHANGE_DEFAULT_UNATTENDED) |
| return false; |
| // We really do want the outer bundle here, not the main bundle since setting |
| @@ -39,7 +44,7 @@ bool ShellIntegration::SetAsDefaultProtocolClient(const std::string& protocol) { |
| if (protocol.empty()) |
| return false; |
| - if (!CanSetAsDefaultProtocolClient()) |
| + if (CHANGE_DEFAULT_NOT_ALLOWED == CanSetAsDefaultProtocolClient()) |
|
grt (UTC plus 2)
2012/05/25 20:27:38
why is line 27 != _UNATTENDED and this one == NOT_
motek.
2012/05/28 17:40:33
It seemed natural to use a less constraining check
|
| return false; |
| // We really do want the main bundle here since it makes sense to set an |