Bug 1408010 - Fallback to app chooser dialog when external handler app not found, r=Paolo

The nsExternalHelperAppService has been changed to ask for application in case
the preferred application has not been found (to cover the case the user has
uninstalled the application).

MozReview-Commit-ID: 63AFzPhzcxN

--HG--
extra : rebase_source : f91bdae686b062bade1cacdb489c935e30ea0876
This commit is contained in:
Jan Horak 2017-10-19 12:38:19 +02:00
parent 34162c2171
commit ee67df0ab5

View File

@ -1009,9 +1009,16 @@ nsExternalHelperAppService::LoadURI(nsIURI *aURI,
// if we are not supposed to ask, and the preferred action is to use
// a helper app or the system default, we just launch the URI.
if (!alwaysAsk && (preferredAction == nsIHandlerInfo::useHelperApp ||
preferredAction == nsIHandlerInfo::useSystemDefault))
return handler->LaunchWithURI(uri, aWindowContext);
preferredAction == nsIHandlerInfo::useSystemDefault)) {
rv = handler->LaunchWithURI(uri, aWindowContext);
// We are not supposed to ask, but when file not found the user most likely
// uninstalled the application which handles the uri so we will continue
// by application chooser dialog.
if (rv != NS_ERROR_FILE_NOT_FOUND) {
return rv;
}
}
nsCOMPtr<nsIContentDispatchChooser> chooser =
do_CreateInstance("@mozilla.org/content-dispatch-chooser;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);