New issue
Advanced search Search tips

Issue 818124 link

Starred by 1 user

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug

Blocking:
issue 791824



Sign in to add a comment

Notify BrowserWindowObservers when window state changes on Mac

Project Member Reported by michae...@chromium.org, Mar 2 2018

Issue description

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

Status: Available (was: Untriaged)
[mac triage]

You may be able to get some or all of what you need from 
NSWindow lifecycle notifications (https://developer.apple.com/documentation/appkit/nswindow, scroll down to "Notifications").

Depending on your timeline, it might be worth it to wait for MacViews.
Status: Archived (was: Available)
Archiving old bugs that haven't been actively assigned in over 180 days.

If you feel this issue should still be addressed, feel free to reopen it or to file a new issue. Thanks!
Status: Available (was: Archived)
I asked Rob if this still applies with MacViews and his comment was that it still uses NSWindows, so presumably comment 1 is still correct.
Labels: Hotlist-DesktopUIToolingRequired Hotlist-DesktopUIChecked

Sign in to add a comment