I would rather have both, and I imagine the chrome one is easier to implement: either it asks for permissions or it doesn’t. Since there are valid reasons to keep the machine awake after closing the lid (close out connections, save files to disk, etc), it’s maybe harder to tell when one is going too long.

Actually, thinking about it, it wouldn’t be that hard to implement for both that and background processes that eat up cpu.