There exist several mechanisms for updating a WindowTreeHost's bounds
- OnHostMoved/ResizedInPixels
- gives a message that passes the new bounds
- GetBounds()
- calls into the sub-class and returns something
- this may or may not match OnHostMoved/ResizedInPixels
- UpdateRootWindowSizeInPixels
- this usually given GetBounds as an argument
- except when called by RootWindowController, where its goal is unclear
This makes it impossible to reason precisely about what is meant by "bounds" for an aura::WindowTreeHost, and makes maintenance of the code very difficult.
I have spent several days trying to introduce CHECKs on LayerTreeHost surface invariants, and my inability to coherently navigate this code has been the primary culprit.
Ideally this should be changed so that
- OnHostMoved/ResizedInPixels
- is the only way that changes in bounds may be propagated
- GetBounds
- always returns value most recently sent to OnHostMoved/ResizedInPixels
- UpdateRootWindowSizeInPixels
- shouldn't exist as a public method
Comment 1 by kylec...@chromium.org
, Mar 22 2018