Closed Bug 1943211 Opened 1 month ago Closed 1 month ago

SuggestFeature.shouldEnable shouldn't need to check the prefs in enablingPreferences

Categories

(Firefox :: Address Bar, task, P3)

task

Tracking

()

RESOLVED FIXED
136 Branch
Tracking Status
firefox136 --- fixed

People

(Reporter: adw, Assigned: adw)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sng])

Attachments

(1 file)

This is part of some Suggest refactoring/cleanup I'd like to do.

SuggestFeature has shouldEnable and enablingPreferences properties. Right now, each feature's shouldEnable implementation has to check the prefs in its enablingPreferences implementation, effectively duplicating that bit of code. That's unnecessary and the Suggest framework should do that automatically.

This patch makes it unnecessary for most features to have to override
shouldEnable. Instead, the Suggest framework will check enablingPreferences
plus a new property called additionalEnablingPredicate. Summary:

  • Include Nimbus variables in enablingPreferences
  • Add a new property to SuggestFeature called additionalEnablingPredicate
  • Make shouldEnable call enablingPreferences and
    additionalEnablingPredicate
  • Remove shouldEnable implementations on most features
Pushed by dwillcoxon@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/61108343678e Make SuggestFeature.shouldEnable check enablingPreferences. r=daisuke
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 136 Branch
Blocks: 1946894
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: