Bug 1714344 - Replace the deprecated Nimbus.url.getValue calls r=adw,andreio,preferences-reviewers,jaws

Differential Revision: https://phabricator.services.mozilla.com/D116724
This commit is contained in:
Nan Jiang 2021-06-03 23:19:56 +00:00
Родитель f021feb29f
Коммит 1fb559ba1d
3 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -248,7 +248,7 @@ var gSearchPane = {
let container = document.getElementById("showQuickSuggestContainer");
let desc = document.getElementById("searchSuggestionsDesc");
if (!NimbusFeatures.urlbar.getValue().quickSuggestEnabled) {
if (!UrlbarPrefs.get("quickSuggestEnabled")) {
// The experiment is not enabled. This is the default, so to avoid
// accidentally messing anything up, only modify the doc if we're being
// called due to a change in the experiment enabled status.

Просмотреть файл

@ -553,7 +553,7 @@ class Preferences {
get _nimbus() {
if (!this.__nimbus) {
this.__nimbus = NimbusFeatures.urlbar.getValue();
this.__nimbus = NimbusFeatures.urlbar.getAllVariables();
}
return this.__nimbus;
}
@ -655,7 +655,7 @@ class Preferences {
*
* @param {string} name
* The name of the desired property in the object returned from
* NimbusFeatures.urlbar.getValue().
* NimbusFeatures.urlbar.getAllVariables().
* @returns {object}
* An object describing the property's value with the following shape (same
* as _getPrefDescriptor()):

Просмотреть файл

@ -297,12 +297,12 @@ class ProviderQuickSuggest extends UrlbarProvider {
_updateExperimentState() {
Services.telemetry.setEventRecordingEnabled(
TELEMETRY_EVENT_CATEGORY,
NimbusFeatures.urlbar.getValue().quickSuggestEnabled
UrlbarPrefs.get("quickSuggestEnabled")
);
// QuickSuggest is only loaded by the UrlBar on it's first query, however
// there is work it can preload when idle instead of starting it on user
// input. Referencing it here will trigger its import and init.
if (NimbusFeatures.urlbar.getValue().quickSuggestEnabled) {
if (UrlbarPrefs.get("quickSuggestEnabled")) {
UrlbarQuickSuggest; // eslint-disable-line no-unused-expressions
}
}