Merge pull request #3036 from yurydelendik/appswitch

Fixes pdf application switching in FF22/23 (redo)
This commit is contained in:
Brendan Dahl 2013-04-03 13:12:53 -07:00
commit 98d5703565
2 changed files with 38 additions and 28 deletions

View file

@ -101,23 +101,6 @@ function getDOMWindow(aChannel) {
return win;
}
function isEnabled() {
if (MOZ_CENTRAL) {
var disabled = getBoolPref(PREF_PREFIX + '.disabled', false);
if (disabled)
return false;
// To also be considered enabled the "Preview in Firefox" option must be
// selected in the Application preferences.
var handlerInfo = Svc.mime
.getFromTypeAndExtension('application/pdf', 'pdf');
return !handlerInfo.alwaysAskBeforeHandling &&
handlerInfo.preferredAction == Ci.nsIHandlerInfo.handleInternally;
}
// Always returns true for the extension since enabling/disabling is handled
// by the add-on manager.
return true;
}
function getLocalizedStrings(path) {
var stringBundle = Cc['@mozilla.org/intl/stringbundle;1'].
getService(Ci.nsIStringBundleService).
@ -583,9 +566,6 @@ PdfStreamConverter.prototype = {
// nsIStreamConverter::asyncConvertData
asyncConvertData: function(aFromType, aToType, aListener, aCtxt) {
if (!isEnabled())
throw Cr.NS_ERROR_NOT_IMPLEMENTED;
// Store the listener passed to us
this.listener = aListener;
},