Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(109)

Issue 2138213003: Mac: Do layout before adding the WebContents to the view hierarchy when switching tabs (Closed)

Created:
4 years, 5 months ago by tapted
Modified:
4 years, 5 months ago
Reviewers:
ccameron
CC:
chromium-reviews, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Mac: 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+39 lines, -71 lines) Patch
M chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.h View 1 2 3 4 2 chunks +7 lines, -13 lines 0 comments Download
M chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm View 1 2 3 4 8 chunks +19 lines, -24 lines 0 comments Download
M chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm View 1 2 3 4 1 chunk +13 lines, -34 lines 0 comments Download

Messages

Total messages: 15 (8 generated)
tapted
Hi Chris please take a look
4 years, 5 months ago (2016-07-12 07:33:21 UTC) #5
ccameron
lgtm w/suggestions. LMK if we should plow on with the ScopedRWHViewActionDisabler beast ... it might ...
4 years, 5 months ago (2016-07-12 18:56:58 UTC) #6
tapted
https://codereview.chromium.org/2138213003/diff/60001/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm File chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm (right): https://codereview.chromium.org/2138213003/diff/60001/chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm#newcode220 chrome/browser/ui/cocoa/tab_contents/tab_contents_controller.mm:220: - (void)addContentsToView:(NSView*)superview { On 2016/07/12 18:56:58, ccameron wrote: > ...
4 years, 5 months ago (2016-07-13 03:33:18 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2138213003/80001
4 years, 5 months ago (2016-07-13 03:35:04 UTC) #10
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 5 months ago (2016-07-13 03:45:56 UTC) #12
commit-bot: I haz the power
CQ bit was unchecked.
4 years, 5 months ago (2016-07-13 03:46:34 UTC) #13
commit-bot: I haz the power
4 years, 5 months ago (2016-07-13 03:48:15 UTC) #15
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/dfe8ae7e645a40ef10acfec1c4b2fdabb46a0735
Cr-Commit-Position: refs/heads/master@{#404977}

Powered by Google App Engine
This is Rietveld 408576698