Bug 482154 - Restructure default app lookup code. Patch by Stuart Morgan <stuart.morgan+bugzilla@gmail.com>, r/sr=pink
git-svn-id: svn://10.0.0.236/trunk@256641 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
bf1fc9f14a
commit
e05bc08aee
@ -67,29 +67,34 @@
|
||||
}
|
||||
|
||||
- (NSString*)defaultBrowserIdentifier
|
||||
{
|
||||
return [self identifierForBundle:[self defaultBrowserURL]];
|
||||
}
|
||||
|
||||
- (NSString*)defaultFeedViewerIdentifier
|
||||
{
|
||||
return [self identifierForBundle:[self defaultFeedViewerURL]];
|
||||
}
|
||||
|
||||
- (NSURL*)defaultBrowserURL
|
||||
{
|
||||
NSString* defaultBundleId = [(NSString*)LSCopyDefaultHandlerForURLScheme(CFSTR("http")) autorelease];
|
||||
// Sometimes LaunchServices likes to pretend there's no default browser.
|
||||
// If that happens, we'll assume it's probably Safari.
|
||||
if (!defaultBundleId)
|
||||
defaultBundleId = @"com.apple.safari";
|
||||
return [self urlOfApplicationWithIdentifier:defaultBundleId];
|
||||
return defaultBundleId;
|
||||
}
|
||||
|
||||
- (NSString*)defaultFeedViewerIdentifier
|
||||
{
|
||||
return [(NSString*)LSCopyDefaultHandlerForURLScheme(CFSTR("feed")) autorelease];
|
||||
}
|
||||
|
||||
- (NSURL*)defaultBrowserURL
|
||||
{
|
||||
NSString* defaultBundleId = [self defaultBrowserIdentifier];
|
||||
if (defaultBundleId)
|
||||
return [self urlOfApplicationWithIdentifier:defaultBundleId];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSURL*)defaultFeedViewerURL
|
||||
{
|
||||
NSString* defaultBundleId = [(NSString*)LSCopyDefaultHandlerForURLScheme(CFSTR("feed")) autorelease];
|
||||
return [self urlOfApplicationWithIdentifier:defaultBundleId];
|
||||
NSString* defaultBundleId = [self defaultFeedViewerIdentifier];
|
||||
if (defaultBundleId)
|
||||
return [self urlOfApplicationWithIdentifier:defaultBundleId];
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)setDefaultBrowserWithIdentifier:(NSString*)bundleID
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user