MacPWAs: Change ColorPanelCocoa to singleton ColorPanelListener

Prior to this patch each ColorChooserMac allocated its own
ColorPanelCocoa, which would act as an observer on the NSColorPanel.

This ends up with some fairly intricate lifetime management (e.g,
crbug.com/767598) which gets more complicated when trying to add
out-of-process support.

Avoid these lifetime management issues by making the class be a
singleton that observes the singleton NSColorPanel.

Be more explicit about the use of the global ColorChooserMac -- call
it directly from ColorPanelListener rather than storing it as a
redundant member variable.

Bug: 948065
Change-Id: I31b88562feafeebafd219f99ff266b8200400178
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1655208
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#668650}
3 files changed