mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
Merge pull request #16425 from calixteman/gv_nimbus
[GeckoView] Add a Nimbus experiment for the toolbar (bug 1833093)
This commit is contained in:
commit
5f91d39f13
5 changed files with 67 additions and 7 deletions
20
web/app.js
20
web/app.js
|
@ -151,6 +151,10 @@ class DefaultExternalServices {
|
|||
static get canvasMaxAreaInBytes() {
|
||||
return shadow(this, "canvasMaxAreaInBytes", -1);
|
||||
}
|
||||
|
||||
static getNimbusExperimentData() {
|
||||
return shadow(this, "getNimbusExperimentData", Promise.resolve(null));
|
||||
}
|
||||
}
|
||||
|
||||
const PDFViewerApplication = {
|
||||
|
@ -227,12 +231,21 @@ const PDFViewerApplication = {
|
|||
_printAnnotationStoragePromise: null,
|
||||
_touchInfo: null,
|
||||
_isCtrlKeyDown: false,
|
||||
_nimbusDataPromise: null,
|
||||
|
||||
// Called once when the document is loaded.
|
||||
async initialize(appConfig) {
|
||||
this.preferences = this.externalServices.createPreferences();
|
||||
this.appConfig = appConfig;
|
||||
|
||||
if (
|
||||
typeof PDFJSDev === "undefined"
|
||||
? window.isGECKOVIEW
|
||||
: PDFJSDev.test("GECKOVIEW")
|
||||
) {
|
||||
this._nimbusDataPromise = this.externalServices.getNimbusExperimentData();
|
||||
}
|
||||
|
||||
await this._initializeOptions();
|
||||
this._forceCssTheme();
|
||||
await this._initializeL10n();
|
||||
|
@ -584,7 +597,12 @@ const PDFViewerApplication = {
|
|||
: PDFJSDev.test("GECKOVIEW")
|
||||
) {
|
||||
if (AppOptions.get("enableFloatingToolbar")) {
|
||||
this.toolbar = new Toolbar(appConfig.toolbar, eventBus, this.l10n);
|
||||
this.toolbar = new Toolbar(
|
||||
appConfig.toolbar,
|
||||
eventBus,
|
||||
this.l10n,
|
||||
await this._nimbusDataPromise
|
||||
);
|
||||
}
|
||||
} else {
|
||||
this.toolbar = new Toolbar(appConfig.toolbar, eventBus, this.l10n);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue