Descriptionmac: Refactor browser_window_controller layout logic.
This CL has no intended major functional changes. This CL separates out the
layout logic into its own class. This CL adds unit tests that aren't flaky, as
they have no dependencies on AppKit internals. This CL is in preparation for
further fullscreen refactoring and improvements.
Changes from previous behavior:
- The previous layout logic incorrectly ordered subviews.
- The previous logic for infobar layout was very fragile. The size of the
infobar container depended on the maximum arrow height, which was computed by
the browser_window_controller, which in turn was dependent on the size of the
infobar container. Minor rearragement of the the existing code would result in
an infinite loop.
- Previously, calculating the layout of the infobar required 2 stages. The
frame of the infobar depended on the height of the top arrow. However, the
height of the top arrow was computed by examining the frame of the infobar.
The infobar would be laid out in a preliminary position. Then its frame would
be adjusted to accomodate the top arrow height.
- The new logic for laying out the infobar is much simpler. The infobar's
frame always stretches all the way to the bottom of the location icon in the
toolbar.
- The BrowserWindowController is now the sole entity that determines the
layout of the info bar. (Previously, the InfoBarContainerController would
also try to adjust the layout of the info bar).
- Fixed recently introduced bugs in browser_window_controller_browsertest.mm.
- The download shelf was lazily loaded. This makes it difficult to test. The
existing browser tests that used it were incorrect. Made a method to explicitly
create the download shelf.
- The location bar decorations were not being initialized with images. This
meant that calling Layout() or GetPageInfoBubblePoint() immediately after
initialization would produce the wrong behavior. This changes the logic to ensure
that the class is in a consistent state after initialization.
BUG=406656
Committed: https://crrev.com/4b45b7de6d8b9f44d75cd0718808aabb19dc3d76
Cr-Commit-Position: refs/heads/master@{#295305}
Patch Set 1 : More cleanup. #Patch Set 2 : Comments from andresantoso. Renames, header file changes, no functional changes. #
Total comments: 10
Patch Set 3 : Comments from andresantoso, round 2. #
Total comments: 26
Patch Set 4 : Comments from rsesek. #
Total comments: 4
Patch Set 5 : Comments from rsesek, round 2. #Patch Set 6 : Rebase against top of tree. #Patch Set 7 : Rebase against top of tree. #Patch Set 8 : Ensure location bar in consistent state after initialization. #Messages
Total messages: 69 (35 generated)
|