Commander: refactor composite commands in backend
The original design for this was that when the user selected a composite command, a specialized CommanderBackend object was created, and CommanderController would delegate to it to allow the user to enter details. In practice the impedance was wrong. We need extra information for the composite command (how to prompt the user), *don't* need a lot of other things in the CommanderBackend interface, need to duplicate logic re: command execution and risk lifetime issues with nested composite commands. In this change, composite commands are represented by a pair of prompt text and a lambda with a signature similar to CommandSource::GetCommands. All other logic is is handled by the controller. For a worked example, see the dependent CL https://chromium-review.googlesource.com/c/chromium/src/+/2535677 Bug: 1014639 Change-Id: I07c172584afcf4288a460362099dbd73b412daa7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2536050Reviewed-by:Elly Fong-Jones <ellyjones@chromium.org> Commit-Queue: Leonard Grey <lgrey@chromium.org> Cr-Commit-Position: refs/heads/master@{#827374}
Showing
This diff is collapsed.
Please register or sign in to comment