Bug 389870 - When previous action was to use a local helper app, the protocol never works again. r=cbiesinger, sr=dmose, a=schrep

This commit is contained in:
sdwilsh@shawnwilsher.com 2007-07-27 13:20:54 -07:00
Родитель 2b71ae690f
Коммит ea36e2eef8
1 изменённых файлов: 14 добавлений и 2 удалений

Просмотреть файл

@ -343,14 +343,26 @@ NS_IMETHODIMP nsExtProtocolChannel::AsyncOpen(nsIStreamListener *listener, nsISu
nsCOMPtr<nsIHandlerInfo> handlerInfo;
rv = gExtProtSvc->GetProtocolHandlerInfo(urlScheme,
getter_AddRefs(handlerInfo));
// TODO all this code should be moved to nsIHandlerInfo::LaunchWithURI
if (NS_SUCCEEDED(rv)) {
PRInt32 preferredAction;
rv = handlerInfo->GetPreferredAction(&preferredAction);
// for now, anything that triggers a helper app is going to be a web-based
// protocol handler, so we use that to decide which path to take...
if (preferredAction == nsIHandlerInfo::useHelperApp) {
nsCOMPtr<nsIHandlerApp> handler;
rv = handlerInfo->GetPreferredApplicationHandler(getter_AddRefs(handler));
NS_ENSURE_SUCCESS(rv, rv);
// Now we check to see if this is a local handler or not
nsCOMPtr<nsILocalHandlerApp> localHandler =
do_QueryInterface(handler, &rv);
if (NS_SUCCEEDED(rv)) {
OpenURL();
return NS_ERROR_NO_CONTENT; // force caller to abort
}
// We must have a web handler
// redirecting to the web handler involves calling OnChannelRedirect
// (which is supposed to happen after AsyncOpen completes) or possibly
// opening a dialog, so we do it in an event