mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Re-factor BasePreferences
to essentially be a wrapper around AppOptions
In the MOZCENTRAL build the `BasePreferences` class is almost unused, since it's only being used to initialize and update the `AppOptions` which means that theoretically we could move the relevant code there. However for the other build targets (e.g. GENERIC and CHROME) we still need to keep the `BasePreferences` class, although we can re-factor things to move the necessary validation inside of `AppOptions` and thus simplify the code and reduce duplication. The patch also moves the event dispatching, for changed preference values, into `AppOptions` instead.
This commit is contained in:
parent
1bdd6920ff
commit
d9f0ec0b87
4 changed files with 76 additions and 142 deletions
|
@ -391,9 +391,10 @@ const PDFViewerApplication = {
|
|||
*/
|
||||
async _initializeViewerComponents() {
|
||||
const { appConfig, externalServices, l10n } = this;
|
||||
|
||||
let eventBus;
|
||||
if (typeof PDFJSDev !== "undefined" && PDFJSDev.test("MOZCENTRAL")) {
|
||||
eventBus = this.preferences.eventBus = new FirefoxEventBus(
|
||||
eventBus = AppOptions.eventBus = new FirefoxEventBus(
|
||||
await this._allowedGlobalEventsPromise,
|
||||
externalServices,
|
||||
AppOptions.get("isInAutomation")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue