***Thunderbird Only blocker***

Back out 213538 which attempted to remove a thunderbird ifdef in nsWebShell.cpp. This broke the ability to display mail messages
on mac, linux and win95/win98 builds. Miraculously it sometimes works on win xp, but still has issues.
This commit is contained in:
scott%scott-macgregor.org 2003-08-08 16:20:19 +00:00
Родитель 05eb524d3a
Коммит 46dfe78de0
2 изменённых файлов: 43 добавлений и 65 удалений

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

@ -560,6 +560,49 @@ nsWebShell::OnLinkClickSync(nsIContent *aContent,
nsIDocShell** aDocShell,
nsIRequest** aRequest)
{
#ifdef MOZ_THUNDERBIRD
// XXX ugly thunderbird hack to force all url clicks to go to the system default app
// I promise this will be removed once we figure out a better way.
nsCAutoString scheme;
aURI->GetScheme(scheme);
nsCAutoString spec;
aURI->GetSpec(spec);
static const char kMailToURI[] = "mailto";
static const char kNewsURI[] = "news";
static const char kSnewsURI[] = "snews";
static const char kNntpURI[] = "nntp";
static const char kImapURI[] = "imap";
if (scheme.EqualsIgnoreCase(kMailToURI))
{
// the scheme is mailto, we can handle it
}
else if (scheme.EqualsIgnoreCase(kNewsURI))
{
// the scheme is news, we can handle it
}
else if (scheme.EqualsIgnoreCase(kSnewsURI))
{
// the scheme is snews, we can handle it
}
else if (scheme.EqualsIgnoreCase(kNntpURI))
{
// the scheme is nntp, we can handle it
} else if (scheme.EqualsIgnoreCase(kImapURI))
{
// the scheme is imap, we can handle it
} else
{
// we don't handle this type, the the registered handler take it
nsresult rv = NS_OK;
nsCOMPtr<nsIExternalProtocolService> extProtService = do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
return extProtService->LoadUrl(aURI);
}
#endif
nsCOMPtr<nsIDOMNode> node(do_QueryInterface(aContent));
NS_ENSURE_TRUE(node, NS_ERROR_UNEXPECTED);

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

@ -419,71 +419,6 @@ NS_IMETHODIMP nsMsgWindow::StopUrls()
// nsIURIContentListener support
NS_IMETHODIMP nsMsgWindow::OnStartURIOpen(nsIURI* aURI, PRBool* aAbortOpen)
{
#ifdef MOZ_THUNDERBIRD
// XXX ugly thunderbird hack to force all url clicks to go to the system default app
// I promise this will be removed once we figure out a better way.
nsCAutoString scheme;
aURI->GetScheme(scheme);
nsCAutoString spec;
aURI->GetSpec(spec);
static const char kMailToURI[] = "mailto";
static const char kNewsURI[] = "news";
static const char kSnewsURI[] = "snews";
static const char kNntpURI[] = "nntp";
static const char kImapURI[] = "imap";
static const char kJarURI[] = "jar";
static const char kChromeURI[] = "chrome";
static const char kAboutBlankURI[] = "about:blank";
if (scheme.EqualsIgnoreCase(kMailToURI))
{
// the scheme is mailto, we can handle it
}
else if (scheme.EqualsIgnoreCase(kNewsURI))
{
// the scheme is news, we can handle it
}
else if (scheme.EqualsIgnoreCase(kSnewsURI))
{
// the scheme is snews, we can handle it
}
else if (scheme.EqualsIgnoreCase(kNntpURI))
{
// the scheme is nntp, we can handle it
} else if (scheme.EqualsIgnoreCase(kImapURI))
{
// the scheme is imap, we can handle it
} else if (scheme.EqualsIgnoreCase(kJarURI))
{
// XXX: yet another hack. JAR urls may be kicked off internallying into the message pane browser instance
// we need to allow those to load. But of course we don't want jar urls clicked on in messages to load in this docshell.
// for now, let it happen
}else if (scheme.EqualsIgnoreCase(kChromeURI))
{
// XXX: yet another hack. chrome urls may be kicked off internallying into the message pane browser instance
// we need to allow those to load. But of course we don't want jar urls clicked on in messages to load in this docshell.
// for now, let it happen
}else if (spec.EqualsIgnoreCase(kAboutBlankURI)) // XXX hack alert....allow about:blank
{
// XXX note to self...with this new way of kicking urls out to the desktop, we are having problems
// when html content legitimately trys to load in the message pane browser element such as the start page,
// or about:blank. We need to find a way to distinguish these load attempts so we can allow them.
}
else
{
// we don't handle this type, the the registered handler take it
nsresult rv = NS_OK;
nsCOMPtr<nsIExternalProtocolService> extProtService = do_GetService(NS_EXTERNALPROTOCOLSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv,rv);
rv = extProtService->LoadUrl(aURI);
*aAbortOpen = PR_TRUE;
return rv;
}
#endif
return NS_OK;
}