Closed Bug 1689230 Opened 3 months ago Closed 2 months ago

Simplify gViewController API methods

Categories

(Toolkit :: Add-ons Manager, task, P2)

task

Tracking

()

RESOLVED FIXED
88 Branch
Tracking Status
firefox88 --- fixed

People

(Reporter: ntim, Assigned: ntim)

References

Details

Attachments

(1 file)

After bug 1525179:

  • gViewController.loadInitialView is the same as gViewController.replaceView for current usages, since currentViewId is always an empty string or null

  • gViewController.replaceView isn't used aside for replaceWithDefaultViewFn. It could be implemented as an argument for gViewController.loadView

  • gViewController.updateState is the same as gViewController.loadViewInternal, with slightly different args, these can be combined in a renderView method.

  • initialViewSelected is essentially the same as checking for the existence of currentViewId

  • I think it's worth adding a resetView helper which would be the equivalent of replaceWithDefaultViewFn

This way, gViewController can have a clear API with 3 methods: loadView/resetView/renderView which matches how gViewController is actually used. Also, external callers can call into loadView without knowing the initialization state.

Assignee: nobody → ntim.bugs
Status: NEW → ASSIGNED
Severity: -- → N/A
Priority: -- → P2
Pushed by ntim.bugs@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/033aea12b973
Simplify gViewController API methods. r=rpl
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 88 Branch
You need to log in before you can comment on or make changes to this bug.