Merge pull request #5917 from Snuffleupagus/bug-1148192-review-comments

Address review comments from Bug 1148192 - Update pdf.js to version 1.1.24
This commit is contained in:
Yury Delendik 2015-04-20 10:23:52 -05:00
commit ebd6ce33b5
2 changed files with 11 additions and 16 deletions

View File

@ -501,8 +501,6 @@ ChromeActions.prototype = {
var winmm = this.domWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell)
.sameTypeRootTreeItem
.QueryInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager);
@ -815,8 +813,6 @@ function FindEventManager(contentWindow) {
this.contentWindow = contentWindow;
this.winmm = contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDocShell)
.sameTypeRootTreeItem
.QueryInterface(Ci.nsIDocShell)
.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIContentFrameMessageManager);
}

View File

@ -179,9 +179,8 @@ let PdfjsChromeUtils = {
},
handleEvent: function(aEvent) {
// We cannot just forward the message as a CPOW without setting up
// __exposedProps__ on it. Instead, let's just create a structured
// cloneable version of the event for performance and for the ease of usage.
// To avoid forwarding the message as a CPOW, create a structured cloneable
// version of the event for both performance, and ease of usage, reasons.
let type = aEvent.type;
let detail = {
query: aEvent.detail.query,
@ -190,16 +189,16 @@ let PdfjsChromeUtils = {
findPrevious: aEvent.detail.findPrevious
};
let chromeWindow = aEvent.target.ownerDocument.defaultView;
let browser = chromeWindow.gBrowser.selectedBrowser;
if (this._browsers.has(browser)) {
// Only forward the events if the selected browser is a registered
// browser.
let mm = browser.messageManager;
mm.sendAsyncMessage('PDFJS:Child:handleEvent',
{ type: type, detail: detail });
aEvent.preventDefault();
let browser = aEvent.currentTarget.browser;
if (!this._browsers.has(browser)) {
throw new Error('FindEventManager was not bound ' +
'for the current browser.');
}
// Only forward the events if the current browser is a registered browser.
let mm = browser.messageManager;
mm.sendAsyncMessage('PDFJS:Child:handleEvent',
{ type: type, detail: detail });
aEvent.preventDefault();
},
_types: ['find',