mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-25 11:15:34 +00:00
d6e76c014e
Lazily load AndroidLog.jsm since we only need it for debug logging, and logging is normally turned off in GeckoView code. MozReview-Commit-ID: 5HNzYTwujMS --HG-- extra : rebase_source : f6902e25a445d29001f93e024e7cc82fddbb58f2
39 lines
1016 B
JavaScript
39 lines
1016 B
JavaScript
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
"use strict";
|
|
|
|
this.EXPORTED_SYMBOLS = ["GeckoViewScroll"];
|
|
|
|
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
|
|
|
|
Cu.import("resource://gre/modules/GeckoViewModule.jsm");
|
|
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
|
|
|
|
XPCOMUtils.defineLazyGetter(this, "dump", () =>
|
|
Cu.import("resource://gre/modules/AndroidLog.jsm",
|
|
{}).AndroidLog.d.bind(null, "ViewScroll"));
|
|
|
|
function debug(aMsg) {
|
|
// dump(aMsg);
|
|
}
|
|
|
|
class GeckoViewScroll extends GeckoViewModule {
|
|
init() {
|
|
debug("init");
|
|
|
|
this.frameScriptLoaded = false;
|
|
}
|
|
|
|
register() {
|
|
debug("register");
|
|
|
|
if (!this.frameScriptLoaded) {
|
|
this.messageManager.loadFrameScript(
|
|
"chrome://geckoview/content/GeckoViewScrollContent.js", true);
|
|
this.frameScriptLoaded = true;
|
|
}
|
|
}
|
|
}
|