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

Unified Diff: chrome/browser/shell_integration_mac.mm

Issue 9240004: Transition to base/mac/bundle_locations.h step 3 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 8 years, 11 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
« no previous file with comments | « chrome/browser/mac/keystone_glue.mm ('k') | chrome/browser/ui/cocoa/dock_icon.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/shell_integration_mac.mm
diff --git a/chrome/browser/shell_integration_mac.mm b/chrome/browser/shell_integration_mac.mm
index be2f6af2f913523e23eba03f7507fdaf0cacd9b3..5b17e9f0d35dae8b495aedbe2435f768c369ded0 100644
--- a/chrome/browser/shell_integration_mac.mm
+++ b/chrome/browser/shell_integration_mac.mm
@@ -22,9 +22,9 @@ bool ShellIntegration::SetAsDefaultBrowser() {
if (!CanSetAsDefaultBrowser())
return false;
- // We really do want the main bundle here, not base::mac::FrameworkBundle(),
- // which is the bundle for the framework.
- NSString* identifier = [[NSBundle mainBundle] bundleIdentifier];
+ // We really do want the outer bundle here, not the main bundle since setting
+ // a shortcut to Chrome as the default browser doesn't make sense.
+ NSString* identifier = [base::mac::OuterBundle() bundleIdentifier];
if (!identifier)
return false;
@@ -42,9 +42,9 @@ bool ShellIntegration::SetAsDefaultProtocolClient(const std::string& protocol) {
if (!CanSetAsDefaultProtocolClient())
return false;
- // We really do want the main bundle here, not base::mac::FrameworkBundle(),
- // which is the bundle for the framework.
- NSString* identifier = [[NSBundle mainBundle] bundleIdentifier];
+ // We really do want the main bundle here since it makes sense to set an
+ // app shortcut as a default protocol handler.
+ NSString* identifier = [base::mac::MainBundle() bundleIdentifier];
if (!identifier)
return false;
@@ -96,9 +96,9 @@ bool IsIdentifierDefaultProtocolClient(NSString* identifier,
// protocols; we don't want to report "no" here if the user has simply chosen
// to open HTML files in a text editor and FTP links with an FTP client.)
ShellIntegration::DefaultWebClientState ShellIntegration::IsDefaultBrowser() {
- // We really do want the main bundle here, not base::mac::FrameworkBundle(),
- // which is the bundle for the framework.
- NSString* my_identifier = [[NSBundle mainBundle] bundleIdentifier];
+ // We really do want the outer bundle here, since this we want to know the
+ // status of the main Chrome bundle and not a shortcut.
+ NSString* my_identifier = [base::mac::OuterBundle() bundleIdentifier];
if (!my_identifier)
return UNKNOWN_DEFAULT_WEB_CLIENT;
@@ -118,9 +118,9 @@ ShellIntegration::DefaultWebClientState
if (protocol.empty())
return UNKNOWN_DEFAULT_WEB_CLIENT;
- // We really do want the main bundle here, not base::mac::FrameworkBundle(),
- // which is the bundle for the framework.
- NSString* my_identifier = [[NSBundle mainBundle] bundleIdentifier];
+ // We really do want the main bundle here since it makes sense to set an
+ // app shortcut as a default protocol handler.
+ NSString* my_identifier = [base::mac::MainBundle() bundleIdentifier];
if (!my_identifier)
return UNKNOWN_DEFAULT_WEB_CLIENT;
« no previous file with comments | « chrome/browser/mac/keystone_glue.mm ('k') | chrome/browser/ui/cocoa/dock_icon.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698