We're adding a BrowserWindowObserver interface that notifies observers when the WindowShowState -- minimized, maximized, etc. -- changes. This is used for logging WindowMetrics events and will be used to count the number of times the window enters these different states, which we expect will be a useful metric for predicting whether the user will reactivate a window.
https://chromium-review.googlesource.com/c/chromium/src/+/890758/
I don't have Cocoa experience and couldn't figure out a good way to observe these changes on Mac. BrowserWindowController has windowDidMiniaturize functions, but no similar functions for when the window enters or exits maximized or fullscreen modes. (It seems Mac has its own versions of these concepts anyway, which further confuses things.)
I think we could track the WindowShowState in BrowserWindowController's private saveWindowPositionIfNeeded function, and call ShowStateChanged() when the show state indeed changes.
Comment 1 by lgrey@chromium.org
, Mar 2 2018