Chromium Code Reviews
DescriptionMac: Do layout before adding the WebContents to the view hierarchy when switching tabs
Currently you can sometimes see a flash of webcontent at the size it was
when a tab was last active, before it updates to fill the window.
This regressed in r378605, which tied a call to WebContents::WasShown to
the insertion into the view hierarchy, which happens before setting the
WebContents size.
There's currently some tricky code to suppress auto-resizing when
switching to/from a tab which might have an infobar showing. Make this
simpler and fix the regression by establishing a correct size for the
WebContents *before* it gets added to the view hierarchy, rather than
after.
Do this by having TabStripController delegate resposibility for setting
view sizes and updating the view heirarchy to TabContentsController.
This is probably nicer anyway, since TabContentsController already has
most of the logic to pick a target WebContents size - it just needs to
know what the size of its superview _will_ be rather than what it
currently is.
BUG=627255
TEST=On Mac, create 2 tabs, make the window small, switch tabs and make
the window big. Switch back to the first tab. There should be no flash
the old, small web contents before it fills the window.
Committed: https://crrev.com/dfe8ae7e645a40ef10acfec1c4b2fdabb46a0735
Cr-Commit-Position: refs/heads/master@{#404977}
Patch Set 1 #Patch Set 2 : An option for addContentsToView: - probably not needed #Patch Set 3 : Smaller diff #Patch Set 4 : selfnits #
Total comments: 8
Patch Set 5 : ensureContentsVisibleInSuperview #
Messages
Total messages: 15 (8 generated)
|
|||||||||||||||||||||||||||||||||||||