BrowserStatusMonitor tracks window activation by installing an observer on ash::Shell's global activation client. It uses window activation to update the shelf status of v1 (non-packaged) apps, especially those running in windows.
I think some of this code can be removed. In particular, ChromeLauncherController has:
// Used to update the state of non plaform apps, as web contents change.
enum AppState {
APP_STATE_ACTIVE,
APP_STATE_WINDOW_ACTIVE,
APP_STATE_INACTIVE,
APP_STATE_REMOVED
};
I think the active vs. inactive states date back to when we drew the dot under a shelf item as bright vs. dim based on the window activation state. Today we just draw the dot with the same brightness all the time, so I think we can just track if the app is running or not.
If that's not enough to kill the shell dependency we might be able to track BrowserList activation instead of aura::Window activation.
Comment 1 by bugdroid1@chromium.org
, Jun 7 2018