There are lots of places in //chrome/browser that call ash::Shell::GetPrimaryRootWindow() or ash::Shell::GetRootWindowForNewWindows() just to set InitParams::context. That won't work in go/mustash (where the Chrome OS "ash" code runs in its own process and the browser doesn't have the entire window tree).
|context| was added for Windows 8 Metro support to make sure new widgets opened on the correct desktop (metro-side ash vs. normal Windows):
https://codereview.chromium.org/11364053/
It got reused for multi-display support in Chrome OS, to ensure windows opened on the right display. However, the Windows code is all gone. Many of the ash call sites use it incorrectly (they just specify primary root window). Ash also has a fallback code path that uses the RootWindowForNewWindows.
I'd like to replace "context" with "target_display_id". I'd also like to make target_display_id optional, and if you don't specify it then the window is placed on display of the RootWindowForNewWindows. If you want the window on the primary display then you can get the primary display id from display::Screen / display::Display.
The migration path would be:
* Make "context" optional (remove the DCHECK that a widget has either a parent or a context) and add target_display_id
* Audit references to "context" and convert to target display
* Remove "context"
Comment 1 by jamescook@chromium.org
, Mar 30 2018