Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactors dependencies of PDFViewerApplication on external services #7202

Merged
merged 4 commits into from
Apr 24, 2016

Conversation

yurydelendik
Copy link
Contributor

... such as FirefoxCom and ChromeCom. It mostly moves external services code into appropriate files. The preprocessor directives will be easier to remove (see #7192).

PDFFindController does not depend on PDFFindBar or FirefoxCom (not tested, but looks like it can be used by third party apps).

@Rob--W, can you review Chromium part?

@@ -150,6 +163,7 @@ var PDFViewerApplication = {
pdfOutlineViewer: null,
/** @type {PDFAttachmentViewer} */
pdfAttachmentViewer: null,
donwloadManager: null,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: spelling downloadManager.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@yurydelendik yurydelendik force-pushed the firefox-deps branch 3 times, most recently from 0032c4d to 34ef359 Compare April 15, 2016 16:21
length: response.contentLength
});
PDFViewerApplication.setTitleUsingUrl(file);
callback(streamUrl, response.contentLength, file);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The callback received three parameters here, but at line 369 only two parameters are used.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Thanks.

@yurydelendik
Copy link
Contributor Author

Also disconnected 'app.js' from 'mozPrintCallback_polyfill.js'.

@yurydelendik
Copy link
Contributor Author

New dependo:

screen shot 2016-04-15 at 4 45 01 pm

@Rob--W
Copy link
Member

Rob--W commented Apr 23, 2016

Looks good to me, can we merge it? The Chrome extension doesn't load any PDF at the moment because ChromeCom is undefined at

pdf.js/web/app.js

Line 1516 in ff6669d

//#if CHROME
.

'findhighlightallchange',
'findcasesensitivitychange'
];
this.handleEvent = this.handleEvent.bind(this);
Copy link
Collaborator

@Snuffleupagus Snuffleupagus Apr 23, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering, do we actually need the this.handleEvent method now, since it's basically just a wrapper around this.executeCommand?
Couldn't we simply remove the method, and use a local function here instead, e.g. something like this:

var handleEvent = function (e) {
  this.executeCommand(e.type, e.detail);
}.bind(this);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was preserving that for the solutions that might use it. But looks like it will be wrong to provide this as an API in the future.

@Snuffleupagus
Copy link
Collaborator

/botio-windows preview

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.22.172.223:8877/224c591229ad9d8/output.txt

@Snuffleupagus
Copy link
Collaborator

@yurydelendik This looks really good, thank you!
r=me; feel free to land this with, or without in case you disagree, my comment above addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants