Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4447)

Unified Diff: chrome/browser/shell_integration_mac.mm

Issue 10453041: Support for interactive set-chrome-as-default in Windows. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed for unittests + a typo or two. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..932630eb9902c6cef77c41c6e7a6092bd2d8a4c7 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 (CanSetAsDefaultBrowser() != CHANGE_DEFAULT_UNATTENDED)
grt (UTC plus 2) 2012/06/01 14:36:39 CanSetAsDefaultBrowser -> CanSetAsDefaultProtocolC
motek. 2012/06/01 20:50:17 Done.
return false;
// We really do want the main bundle here since it makes sense to set an

Powered by Google App Engine
This is Rietveld 408576698