Add support for an old type of Apple event so that preview from Dreamweaver (<= CS4) works again. b=549680 r=josh

This commit is contained in:
Smokey Ardisson 2010-03-24 13:33:04 -04:00
parent fa2294d8b4
commit 34bc3d456b

View File

@ -112,10 +112,17 @@ SetupMacApplicationDelegate()
NS_OBJC_BEGIN_TRY_ABORT_BLOCK_RETURN;
if ((self = [super init])) {
[[NSAppleEventManager sharedAppleEventManager] setEventHandler:self
NSAppleEventManager *aeMgr = [NSAppleEventManager sharedAppleEventManager];
[aeMgr setEventHandler:self
andSelector:@selector(handleAppleEvent:withReplyEvent:)
forEventClass:kInternetEventClass
andEventID:kAEGetURL];
[aeMgr setEventHandler:self
andSelector:@selector(handleAppleEvent:withReplyEvent:)
forEventClass:'WWW!'
andEventID:'OURL'];
}
return self;
@ -126,7 +133,9 @@ SetupMacApplicationDelegate()
{
NS_OBJC_BEGIN_TRY_ABORT_BLOCK;
[[NSAppleEventManager sharedAppleEventManager] removeEventHandlerForEventClass:kInternetEventClass andEventID:kAEGetURL];
NSAppleEventManager *aeMgr = [NSAppleEventManager sharedAppleEventManager];
[aeMgr removeEventHandlerForEventClass:kInternetEventClass andEventID:kAEGetURL];
[aeMgr removeEventHandlerForEventClass:'WWW!' andEventID:'OURL'];
[super dealloc];
NS_OBJC_END_TRY_ABORT_BLOCK;
@ -364,7 +373,8 @@ static NSWindow* GetCocoaWindowForXULWindow(nsISupports *aXULWindow)
if (!event)
return;
if ([event eventClass] == kInternetEventClass && [event eventID] == kAEGetURL) {
if (([event eventClass] == kInternetEventClass && [event eventID] == kAEGetURL) ||
([event eventClass] == 'WWW!' && [event eventID] == 'OURL')) {
NSString* urlString = [[event paramDescriptorForKeyword:keyDirectObject] stringValue];
// don't open chrome URLs