Warn user when closing last tab during download, not after close.

Creates a more general system to prompt the user when something *might*
end up closing the browser. When MaybeWarnBeforeClosing() is called,
all of the prompts are shown, and if any dialogs do result a callback
happens when they're done. Both the existing on-close logic as well as
the "we might be closing the last tab" logic use this path now.

Bug: 916929,918683
Change-Id: I709bc7205ddb840023c9ca3f696ebceae9a5cee6
Reviewed-on: https://chromium-review.googlesource.com/c/1400051
Reviewed-by: Avi Drissman <avi@chromium.org>
Commit-Queue: Dana Fried <dfried@chromium.org>
Cr-Commit-Position: refs/heads/master@{#621224}
9 files changed