[Pkg-javascript-commits] [pdf.js] 34/157: Bug 1179262 - Remove PlayPreview registration from PDF Viewer.
David Prévot
taffit at moszumanska.debian.org
Tue Aug 11 06:46:30 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit 0b5330781c367fcbc997947adbf2bdcdf71f61bc
Author: Yury Delendik <ydelendik at mozilla.com>
Date: Thu Jul 2 12:59:17 2015 -0500
Bug 1179262 - Remove PlayPreview registration from PDF Viewer.
---
extensions/firefox/bootstrap.js | 9 +++++++++
extensions/firefox/content/PdfJs.jsm | 22 +++++++++-------------
extensions/firefox/content/PdfStreamConverter.jsm | 3 +++
make.js | 8 +++++++-
4 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/extensions/firefox/bootstrap.js b/extensions/firefox/bootstrap.js
index 93f8711..6d7f68d 100644
--- a/extensions/firefox/bootstrap.js
+++ b/extensions/firefox/bootstrap.js
@@ -85,12 +85,21 @@ Factory.prototype = {
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
registrar.registerFactory(proto.classID, proto.classDescription,
proto.contractID, this);
+
+ if (proto.classID2) {
+ this._classID2 = proto.classID2;
+ registrar.registerFactory(proto.classID2, proto.classDescription,
+ proto.contractID2, this);
+ }
},
unregister: function unregister() {
var proto = this._targetConstructor.prototype;
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
registrar.unregisterFactory(proto.classID, this);
+ if (this._classID2) {
+ registrar.unregisterFactory(this._classID2, this);
+ }
this._targetConstructor = null;
},
diff --git a/extensions/firefox/content/PdfJs.jsm b/extensions/firefox/content/PdfJs.jsm
index 82cc5c2..2503eec 100644
--- a/extensions/firefox/content/PdfJs.jsm
+++ b/extensions/firefox/content/PdfJs.jsm
@@ -112,11 +112,20 @@ Factory.prototype = {
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
registrar.registerFactory(proto.classID, proto.classDescription,
proto.contractID, factory);
+
+ if (proto.classID2) {
+ this._classID2 = proto.classID2;
+ registrar.registerFactory(proto.classID2, proto.classDescription,
+ proto.contractID2, factory);
+ }
},
unregister: function unregister() {
var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
registrar.unregisterFactory(this._classID, this._factory);
+ if (this._classID2) {
+ registrar.unregisterFactory(this._classID2, this._factory);
+ }
this._factory = null;
}
};
@@ -305,13 +314,6 @@ let PdfJs = {
Cu.import('resource://pdf.js/PdfStreamConverter.jsm');
this._pdfStreamConverterFactory.register(PdfStreamConverter);
- this._pdfRedirectorFactory = new Factory();
- Cu.import('resource://pdf.js/PdfRedirector.jsm');
- this._pdfRedirectorFactory.register(PdfRedirector);
-
- Svc.pluginHost.registerPlayPreviewMimeType(PDF_CONTENT_TYPE, true,
- 'data:application/x-moz-playpreview-pdfjs;,');
-
this._registered = true;
},
@@ -323,12 +325,6 @@ let PdfJs = {
Cu.unload('resource://pdf.js/PdfStreamConverter.jsm');
delete this._pdfStreamConverterFactory;
- this._pdfRedirectorFactory.unregister();
- Cu.unload('resource://pdf.js/PdfRedirector.jsm');
- delete this._pdfRedirectorFactory;
-
- Svc.pluginHost.unregisterPlayPreviewMimeType(PDF_CONTENT_TYPE);
-
this._registered = false;
}
};
diff --git a/extensions/firefox/content/PdfStreamConverter.jsm b/extensions/firefox/content/PdfStreamConverter.jsm
index 61e0c16..584bd6f 100644
--- a/extensions/firefox/content/PdfStreamConverter.jsm
+++ b/extensions/firefox/content/PdfStreamConverter.jsm
@@ -868,6 +868,9 @@ PdfStreamConverter.prototype = {
classDescription: 'pdf.js Component',
contractID: '@mozilla.org/streamconv;1?from=application/pdf&to=*/*',
+ classID2: Components.ID('{PDFJSSCRIPT_STREAM_CONVERTER2_ID}'),
+ contractID2: '@mozilla.org/streamconv;1?from=application/pdf&to=text/html',
+
QueryInterface: XPCOMUtils.generateQI([
Ci.nsISupports,
Ci.nsIStreamConverter,
diff --git a/make.js b/make.js
index 0369614..d82db2e 100644
--- a/make.js
+++ b/make.js
@@ -62,7 +62,9 @@ var ROOT_DIR = __dirname + '/', // absolute path to project's root
MOZCENTRAL_PREF_PREFIX = 'pdfjs',
FIREFOX_PREF_PREFIX = 'extensions.uriloader at pdf.js',
MOZCENTRAL_STREAM_CONVERTER_ID = 'd0c5195d-e798-49d4-b1d3-9324328b2291',
- FIREFOX_STREAM_CONVERTER_ID = '6457a96b-2d68-439a-bcfa-44465fbcdbb1';
+ FIREFOX_STREAM_CONVERTER_ID = '6457a96b-2d68-439a-bcfa-44465fbcdbb1',
+ MOZCENTRAL_STREAM_CONVERTER2_ID = 'd0c5195d-e798-49d4-b1d3-9324328b2292',
+ FIREFOX_STREAM_CONVERTER2_ID = '6457a96b-2d68-439a-bcfa-44465fbcdbb2';
var DEFINES = {
PRODUCTION: true,
@@ -833,6 +835,8 @@ target.firefox = function() {
sed('-i', /PDFJSSCRIPT_STREAM_CONVERTER_ID/, FIREFOX_STREAM_CONVERTER_ID,
FIREFOX_BUILD_CONTENT_DIR + 'PdfStreamConverter.jsm');
+ sed('-i', /PDFJSSCRIPT_STREAM_CONVERTER2_ID/, FIREFOX_STREAM_CONVERTER2_ID,
+ FIREFOX_BUILD_CONTENT_DIR + 'PdfStreamConverter.jsm');
sed('-i', /PDFJSSCRIPT_PREF_PREFIX/, FIREFOX_PREF_PREFIX,
FIREFOX_BUILD_CONTENT_DIR + 'PdfStreamConverter.jsm');
sed('-i', /PDFJSSCRIPT_MOZ_CENTRAL/, 'false',
@@ -966,6 +970,8 @@ target.mozcentral = function() {
sed('-i', /PDFJSSCRIPT_STREAM_CONVERTER_ID/, MOZCENTRAL_STREAM_CONVERTER_ID,
MOZCENTRAL_CONTENT_DIR + 'PdfStreamConverter.jsm');
+ sed('-i', /PDFJSSCRIPT_STREAM_CONVERTER2_ID/, MOZCENTRAL_STREAM_CONVERTER2_ID,
+ MOZCENTRAL_CONTENT_DIR + 'PdfStreamConverter.jsm');
sed('-i', /PDFJSSCRIPT_PREF_PREFIX/, MOZCENTRAL_PREF_PREFIX,
MOZCENTRAL_CONTENT_DIR + 'PdfStreamConverter.jsm');
sed('-i', /PDFJSSCRIPT_MOZ_CENTRAL/, 'true',
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list